Continuous Forms - Combo box.RowSource

Hi
I have a subform with the records displayed in the Continuous Forms
view. On each line, I have a group & a subgroup. Both fields are Combo
boxes. What I am trying to do is limit the choice of subgroups to
those pertaining to the group shown.
I have tried putting code in the On Current event in the form to allow
only the correct subgroups in the Combo box, but it seems to take the
criteria for the top record & apply it to all the others.

This is the code:-

Dim strSQL                  As String
strSQL = "SELECT TLK_SubGroups.PK_SubGroup,
TLK_SubGroups.TXT_SubAbriv, TLK_SubGroups.TXT_SubDet,
TLK_SubGroups.FK_MainGroup " & _
         "FROM TLK_SubGroups " & _
         "WHERE (((TLK_SubGroups.FK_MainGroup)=" & PK_Group & "));"

PK_SubGroup.RowSource = strSQL
PK_SubGroup.Requery

Any ideas how I can make it work?

Stapes

0
Stapes
5/23/2007 11:27:07 AM
access 16762 articles. 3 followers. Follow

2 Replies
685 Views

Similar Articles

[PageSpeed] 27

Stapes,

You could try putting that code in the OnEnter event of the combo box, so it 
would should run it before the list drops down.
(have not tested).

HTH

Rico

"Stapes" wrote:

> Hi
> I have a subform with the records displayed in the Continuous Forms
> view. On each line, I have a group & a subgroup. Both fields are Combo
> boxes. What I am trying to do is limit the choice of subgroups to
> those pertaining to the group shown.
> I have tried putting code in the On Current event in the form to allow
> only the correct subgroups in the Combo box, but it seems to take the
> criteria for the top record & apply it to all the others.
> 
> This is the code:-
> 
> Dim strSQL                  As String
> strSQL = "SELECT TLK_SubGroups.PK_SubGroup,
> TLK_SubGroups.TXT_SubAbriv, TLK_SubGroups.TXT_SubDet,
> TLK_SubGroups.FK_MainGroup " & _
>          "FROM TLK_SubGroups " & _
>          "WHERE (((TLK_SubGroups.FK_MainGroup)=" & PK_Group & "));"
> 
> PK_SubGroup.RowSource = strSQL
> PK_SubGroup.Requery
> 
> Any ideas how I can make it work?
> 
> Stapes
> 
> 
0
Utf
5/23/2007 12:00:01 PM
On my website (www.rogersaccesslibrary.com), is a small Access database 
sample called "CascadingComboInSubform.mdb" which illustrates how to do 
this.

-- 
--Roger Carlson
  MS Access MVP
  Access Database Samples: www.rogersaccesslibrary.com
  Want answers to your Access questions in your Email?
  Free subscription:
  http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


"Stapes" <steve.staple@gmail.com> wrote in message 
news:1179919626.905782.126490@p47g2000hsd.googlegroups.com...
> Hi
> I have a subform with the records displayed in the Continuous Forms
> view. On each line, I have a group & a subgroup. Both fields are Combo
> boxes. What I am trying to do is limit the choice of subgroups to
> those pertaining to the group shown.
> I have tried putting code in the On Current event in the form to allow
> only the correct subgroups in the Combo box, but it seems to take the
> criteria for the top record & apply it to all the others.
>
> This is the code:-
>
> Dim strSQL                  As String
> strSQL = "SELECT TLK_SubGroups.PK_SubGroup,
> TLK_SubGroups.TXT_SubAbriv, TLK_SubGroups.TXT_SubDet,
> TLK_SubGroups.FK_MainGroup " & _
>         "FROM TLK_SubGroups " & _
>         "WHERE (((TLK_SubGroups.FK_MainGroup)=" & PK_Group & "));"
>
> PK_SubGroup.RowSource = strSQL
> PK_SubGroup.Requery
>
> Any ideas how I can make it work?
>
> Stapes
> 


0
Roger
5/23/2007 1:28:06 PM
Reply:

Similar Artilces:

Inserting Picture in Table for Form
I am creating a form that will make use of various graphic images (Line Drawings) that I hope to create using some program such as Daw. I have added an OLE field to the table, and included it as the data for a control that takes up about half the screen on a form. When I open the form all I get are two litttle boxes in the upper right hand corner of the control, and when I click on the control, it says the text is too large to be edited. This is the first time I have done anything like this. I am using Access 2000, and am fairly familiar with VBA if any coding is needed. Do I have...

adding multiple new recrods using popup form
Hi, I have a main form, frmEvents, which contains a datasheet subform, frmEvetsSub, listing each meeting that occured at a particular event. I'd like the users to be able to click a button to add new meetings to the event by opening a data entry form, frmMeetingDetails. The problem I'm having is that I'd like them to be able to enter multiple meetings with frmMeetingDetails, and if I set it to "Data Entry = Yes" it only allows one meeting at a time. Then the user has to go back to frmEvents and click the button again to enter more meetings. There is a...

MTA Errors continued...
The other day I made a post about an MTA error we experienced on our exchange 5.5 server after moving a client mailbox from 5.5 to our 2003 exch server (same site, os also 03'). I stopped the AV on the 2003 server, and restarted the MTA on the 2003 server and I was able to receive external email... all seemed fine, I moved a few other people with no issues. Well as it turns out, today I moved another small batch of users (move mailbox wizard) from our 5.5 server to our new 2003 server. Of the people I moved, 1 user was unable to receive external internet mail. The following even...

Forms Automation
In addition to the Forms Automation product from Liaison, is there any other solutions out there for Great Plains version 8.0? ...

Access form textbox expression builder
I have two fields in my db, one is a long integer, the other is text. I want to display them concatenated in a textbox on a form (i.e. intNumber & " " & txtWords). When I enter the expression in that way, I get "#Name?" as an error. I can't see that I'm doing anything wrong in the expression builder (it doesn't give any issues when I close it, the error appears only when I view the form in Form view). Anyone know how I can get the integer to appear as a string so it will live happily with the text? Hi You need to add an equals sign at the...

Synchronise two combo boxes
I am trying to synchronise two combo boxes on a form but get no list in the second. Details are:- tblRepairCategory RepairCategoryID (Primary Key - Autonumber) RepairCategory (Text) tblRepairType RepairTypeID (Autonumber) RepairCategoryID (Number - Long) RepairType (Text) BuyPrice (Currency) SellPrice (Currency) These two tables are linked by RepairCategoryID - One to Many. My form and combos:- FormName = DependentCombos First Combo Box Name = Categories RowSourceType = Table/Query RowSource = tblRepairCategory ColumnCount = 2 ColumnWidths ...

Text box format missing when saved from 2007 to 2003
I have a chart that have text boxes with borders and colored backgound in Excel 2007. When I saved the file to Excel 2003 and opened the file in 2003, the text boxes formats are no longer there. The borders and colored background are missing. How to make the formats translate correctly from 2007 to 2003? Please help. Thanks. Hi Itan, It is a known issue which should be fixed in a future update. We understand the frustration, but I don't have a solution for you now. -- Thanks, Christopher This posting is provided "AS IS" with no warranties, and confers no rights. "...

code to display for as continuous form
Is there code properties to set a form to displaying as a continous form? If so, what is it? Thanks!! On Sun, 11 Nov 2007 14:23:01 -0800, worksfire1 wrote: > Is there code properties to set a form to displaying as a continous form? If > so, what is it? Thanks!! You can toggle between single form view and continuous form view. Code a command button click event on that form's Header of Footer.: DoCmd.OpenForm "FormName", acDesign If Forms!frmContinuous.DefaultView = 0 Then Forms!frmContinuous.DefaultView = 1 Else Forms!frmContinuous.DefaultView = 0 End I...

Changing a forms name
years ago when starting my Access Program I allowed my main form the use the default name "Table1". I didn't know then how many other things I would be refering back to that form. Now I find new users getting confused. Question: I know MS will allow me to change the name and MS will try to change all references, but I know for experience that does always work. Can I assign an alias? Guess what my main "table" is called? -- Message posted via http://www.accessmonster.com You can create a query with the appropriate name, and Access will use the query rather th...

Open form to proper record
I have a form (fm_menu) with a subform (sf_subform). I have it set up so that the subform opens with DataSource1. When the user double clicks on a record in the subform I post the [Link_id] field value for the active subform record to a field on the main form and then change the datasource for the subform and refresh the subform. When the new record source opens I want the subform to find the record for the [link_id]. What VBA code would I use to do this or is there a different (more preferred) way to do this. Use the Link Master and Link Child fields to sync the subform wit...

Linked Text Boxes #2
The functionality of linking text boxes is great. I am creating a brochure with several sections which are not linked. The individual sections are linked within themselves. The brochure has been developed thus far with a lengthy first section of about 13 pages. That is, one quarter of a folded duplex sheet. That section is followed by two additional sections. There is no interlinking between the sections. Total pages so far is 20. The first section needs additional pages. Using the insert pages menu, inserts 4 pages after page 13. I doubt that the entire four pages will be need...

Creating Sub-forms
I am trying to creat a databse by which I can track the projects my company is doing (mainly to creat estinates and invoices). Currently I have a main form (frmProject) which is based on a table (tblprojects). This form will allow me to enter the file number (primary key), date, customer name and details and other pertinent data. What I need to do now is creat a sub-form. I need this form to allow me to select the various services we provide from and underlying table (tblservices) and "attach" those to the file number. For example, customer XYZ has request a quote for exca...

Lookup record dialog box
The lookup dialog box field for different types of activities are different. For example, if we add job title in the find columns for Contact find (uder form and view). The job title is seachable in Phone activity Receipeint field, but it is not in To field of email. The two lookup foms also look different. Is there a way to make Job title searchable on Email lookup dialog box? Thanks ...

Hide and unhide a form
I have a form, frmStopDailyCounttest in which the user clicks the command button cmdAddstats, which, if there's a value being entered which duplicates something already in the table, then opens frmDuplicateValues. When frmDuplicateValues is opened, what can I do to hide the frmStopDailyCounttest, and when it's closed, how can I unhide it? "Nathan Wolfe" <NathanWolfe@discussions.microsoft.com> wrote in message news:AFF20847-76DC-48BA-9C0F-4EFEEAF1B133@microsoft.com... >I have a form, frmStopDailyCounttest in which the user clicks the command > button cmdAdd...

Creating "records" in Forms
Hello everyone- Need your help. I have to create a UserForm for Purchase Order information that will have multiple Items/Parts (and its info) within a sub-structure. The structure will be as below: PO Number <text_box_field> Vendor ID <text_box_field> Vendor Address <text_box_field> ------------------------- Item # | Item Desc | Qty | ------------------------- 1001 | Cables | 10 | ------------------------- 1002 | Bolts | 1000| <= all text boxes ------------------------- 1003 | Bulbs | 5 | ------------------------- <button for Add_Item> How should I create a ta...

Printing Completed Forms and repeating ref fields
I created a proposal that uses text that needs to be repeated; however, once I place the ref fields in and protected the form, the ref. fields don't automatically update with the the bookmark, it only seems to work when the form is unprotected. The next problem I have is after filling in the completed protected form, I want to create a pdf; however, when I create the pdf, all the fields I populated go back to empty, what am I doing wrong? Did you check the box for "Calculate on exit" in the referenced form field? -- Suzanne S. Barnhill Microsoft MVP (Word) ...

Form wont show records
I have an unbound form which has a unbound combox box called cmbmonth where the user chooses a value from the list for which the record source is based on this SQL statement SELECT tblMonth.txtmonthlabela FROM tblMonth ORDER BY tblMonth.txtmonthlabela DESC; txtmonthlabela is a date field - (I realise that the name is totally misleading but that's how I it was when I got it!) There is then a command button which should open a form which has a control called txtmonth, a date field. However when I click on the form it doesn't show any records. Here is the code behind the...

Creating multi-user Excel form for online
I have created a spreadsheet listing auction items. The columns show the retail value, current bid, minimum bid, etc. These fields have associated formulas. There are three columns that are not locked and can receive entries. I want to be able to somehow use this spreadsheet on a private website for members to bid on the auction items. My problem is that as a spreadsheet, the user must first have Excel and then must save the spreadsheet to record their bids. How do I get around the need for the user to have Excel? When saving it, is it saving to the website file or to tha...

Sending a link for a form to the desktop
I have a multi-user DB with user specific forms. In the old 2003 I was able to right click on a individual form and send it to the specific user's desktop while in development mode but this function isn't appearing in the new 2007 version. Please can I get advice on how to send a launchable link for a form to a user's desktop? On Wed, 12 May 2010 14:29:02 -0700, Cheryl - Student and Mommy <CherylStudentandMommy@discussions.microsoft.com> wrote: It still works for me in A2007 and A2010 by dragging a form object from the Navigation Pane to the desktop. -To...

CRM. Publish in a web a search form of knowledge Base from CRM
Exist any kind of integration or sample about how to integrate in a standard web, or web developed with Sharepoint, a form to allow the Company visitors to search into the Knowledge Base created in Dynamics CRM? ...

Graphs on Forms
I am having a problem getting a graph to display the variables along the right axes. The graph sits on a form which is linked to a parent query. The graph's information comes from a separate crosstab query that is linked to the form via fields from the parent query. The graph fields are day (horizontal axis), race time (Y-axis) and race distance (series field). Unfortunately MS Graph automatically plots the day field as series and the race distance on the X-axis despite the fact that in the crosstab query, I have assigned 'day' as a column heading, 'race distance' as ...

Using a VBA forms text box to show the filename path
Hi, I want that when i launch my userform the activesheet saved location i shown in a text box (textbox1) How can this be done? cheers stev -- Message posted from http://www.ExcelForum.com Do you mean that you want the saved location of the workbook to b displayed? If so, use the following. TEXTBOX1.TEXT = ACTIVEWORKBOOK.FULLNAM Rolli -- Message posted from http://www.ExcelForum.com ...

Calendar continues sending appointment messages to the Deleted Items folder (2nd post)
I have a user who reports her Calendar (Outlook 2000) continues sending appointment messages to the Deleted Items folder. Server is Exchange 5.5 SP4 server. These appointments have been added to the calendar before they have been automatically sent to the Deleted Items folder. She does not have the Resource Scheduling option under Tools->Options->Calendar set to automatically accept. There are no Outlook rules defined that affect appointment items. Apparently this is all default behavior. But how do we turn off this default? Outlook keeps sending unwanted calendar appointment mess...

Bin Location Printing on POP Purchase Order Blank Form for Vendor
We use the POP Purchase Order Blank Form as a pick ticket. I have been able to get the bin location to print on the report for the ship to site, but I am looking to instead have the Bin Location of the vendor (the vendor is our distribution site, where the ship to location is one of our locations that we "sell" items to). We are not using multi-bins. Any Suggestions would be appreciated. Brian Heery More details are needed. Please correct me if I am guessing wrong below.... Your firm actually has more than one operation and these operations buy and sell to and from each othe...

How under the insertion pulls in the excel form tabulates the fram
How under the insertion pulls in the excel form tabulates the frameļ¼Ÿ ...