M
Mike Slater
I know this is wrong, and I'm really sorry, but I'm kinda desperate. I
posted this code last week in Access Forms but I'm under some pressure for an
answer.
I have a form that searches data in a table (not for adding, deleting, or
editing). I have two combo boxes. The first one is for selecting a State
Name. The second combo box shows Agencies in each state.
The first combo box seems to work fine for selecting the state. The second
combo box then shows the relevent entries for each state. The problem is
that I can only select the first record in the second combo box. All records
are shown, but no matter which I select, only the first record shows in that
combo box and in the related text boxes.
This is what I have:
(cboStateName):
Row Source: tblStateName (only column used is StateName)
Type: Table/Query
Event (After Update):
Private Sub cboStateName_AfterUpdate()
Me![cboAgencyName] = Null
Me![cboAgencyName].Requery
End Sub
(cboAgencyName)
Row Source: tblOutOfStateAgencies
1st Field: StateName
Criteria: [Forms]![frmSearchByState]![cboStateName]
2nd Field: AgencyName
3rd Field: PrimaryTelephone
4th Field: DispatchTelephone
5th Field: AlternateTelephone
6th Field: FaxNumber
7th Field: ORI
(tbxPrimaryTelephone)
Control Source: =[cboAgencyName].Column(2)
(tbxDispatchTelephone)
Control Source: =[cboAgecyName].Column(3)
(tbxAlternateTelephone)
Control Source: =[cboAgecyName].Column(4)
(tbxFaxNumber)
Control Source: =[cboAgecyName].Column(5)
(tbxORI)
Control Source: =[cboAgecyName].Column(6)
That's all I have. It works fine for the first record in (cboAgencyName),
but if I select the next record, it stays on the first record. I'm a newb at
this (obviously).
Again, really, really sorry about the double post!!!
Mike
posted this code last week in Access Forms but I'm under some pressure for an
answer.
I have a form that searches data in a table (not for adding, deleting, or
editing). I have two combo boxes. The first one is for selecting a State
Name. The second combo box shows Agencies in each state.
The first combo box seems to work fine for selecting the state. The second
combo box then shows the relevent entries for each state. The problem is
that I can only select the first record in the second combo box. All records
are shown, but no matter which I select, only the first record shows in that
combo box and in the related text boxes.
This is what I have:
(cboStateName):
Row Source: tblStateName (only column used is StateName)
Type: Table/Query
Event (After Update):
Private Sub cboStateName_AfterUpdate()
Me![cboAgencyName] = Null
Me![cboAgencyName].Requery
End Sub
(cboAgencyName)
Row Source: tblOutOfStateAgencies
1st Field: StateName
Criteria: [Forms]![frmSearchByState]![cboStateName]
2nd Field: AgencyName
3rd Field: PrimaryTelephone
4th Field: DispatchTelephone
5th Field: AlternateTelephone
6th Field: FaxNumber
7th Field: ORI
(tbxPrimaryTelephone)
Control Source: =[cboAgencyName].Column(2)
(tbxDispatchTelephone)
Control Source: =[cboAgecyName].Column(3)
(tbxAlternateTelephone)
Control Source: =[cboAgecyName].Column(4)
(tbxFaxNumber)
Control Source: =[cboAgecyName].Column(5)
(tbxORI)
Control Source: =[cboAgecyName].Column(6)
That's all I have. It works fine for the first record in (cboAgencyName),
but if I select the next record, it stays on the first record. I'm a newb at
this (obviously).
Again, really, really sorry about the double post!!!
Mike