kelsita_05
Registered User.
- Local time
- Today, 16:24
- Joined
- Aug 23, 2005
- Messages
- 52
Hi-
In a subform, which is based on a query with two tables, I have a combo box (Field36) that is used to select a name. In the OnExit event, the following code is used to refresh the remaining fields on the subform:
Private Sub Field36_Exit(Cancel As Integer)
On Error GoTo Field36_Exit_Err
DoCmd.RunCommand acCmdRefresh
Field36_Exit_Exit:
Exit Sub
Field36_Exit_Err:
MsgBox Error$
Resume Field36_Exit_Exit
End Sub
We recently changed the name from one field to two (first, last), and now the Row Source for the combobox is:
"Select( [last name] & ", " & [first name]) From [INTRPTBL];"
The Control Source is one field (link name) in a table, and I want both names to end up in there.
The problem is, the code no longer works. Since I'm testing things, I only have one record in INTRPTBL. The data from that record shows up in every line of the continuous subform, regardless of the name that was chosen before. When I try to choose from the combo box, it won't allow me to click on the name, all I get is an angry "ding!"
I'm assuming this has to do with not being able to refresh based on the name in Field36. How can I set it up so it can bring up the appropriate information based on the last, first combination (which are two different fields in the table).
Thanks so much!
In a subform, which is based on a query with two tables, I have a combo box (Field36) that is used to select a name. In the OnExit event, the following code is used to refresh the remaining fields on the subform:
Private Sub Field36_Exit(Cancel As Integer)
On Error GoTo Field36_Exit_Err
DoCmd.RunCommand acCmdRefresh
Field36_Exit_Exit:
Exit Sub
Field36_Exit_Err:
MsgBox Error$
Resume Field36_Exit_Exit
End Sub
We recently changed the name from one field to two (first, last), and now the Row Source for the combobox is:
"Select( [last name] & ", " & [first name]) From [INTRPTBL];"
The Control Source is one field (link name) in a table, and I want both names to end up in there.
The problem is, the code no longer works. Since I'm testing things, I only have one record in INTRPTBL. The data from that record shows up in every line of the continuous subform, regardless of the name that was chosen before. When I try to choose from the combo box, it won't allow me to click on the name, all I get is an angry "ding!"
I'm assuming this has to do with not being able to refresh based on the name in Field36. How can I set it up so it can bring up the appropriate information based on the last, first combination (which are two different fields in the table).
Thanks so much!