Main form fields don't update

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

I've built a form with sub forms for data entry into three
seperate tables for our chorus membership.

The main form is for entry into a special events table.
The fields include bus and motel reservations. I have a
combo box with the member ID, and member name in the
dropdown.

When I select a record from the MemberID combo box no
updating of the record fields occurs. The only time that
such an updating occurs is when I use the record selector
at the bottom of the page.

How can I force the fields to update when I use the Member
ID field?
 
I am working on a similar form and would like to try this
approach. However "use this combo to move to another
record" option doesn't seem to exist. Maybe I need to
install additional options. In any case if you would be
willing to show me the code for this I would appreciate it.

Hrm. I KNOW I've used this wizard... and now it seems to be gone.
Either my memory or my computer's is having problems, obviously,
probably the former!

You would use code SOMETHING LIKE this in the combo's AfterUpdate
event. Make it an Unbound combo box (its Control Source property
should be blank), with its bound column being the Primary Key of the
form's recordsource query; the other colums of the combo can be
whatever will allow the user to select a record logically.

Private Sub cboFindRecord_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone ' get the Form's recordset
rs.FindFirst "[ID] = " & Me!cboFindRecord
' use your primary key fieldname in place of ID
If rs.NoMatch Then
MsgBox "Record Not Found"
rs.MoveFirst
End If
Me.Bookmark = rs.Bookmark ' move to the found record
End Sub
 
John,
Thank you for the help. Perhaps the wizard in question is
an option that needs to be installed.......now if I could
only find my MSAccess disk.
I will try out the code and see what happens. Thanks again
for taking the time to help
John
-----Original Message-----
I am working on a similar form and would like to try this
approach. However "use this combo to move to another
record" option doesn't seem to exist. Maybe I need to
install additional options. In any case if you would be
willing to show me the code for this I would appreciate
it.

Hrm. I KNOW I've used this wizard... and now it seems to be gone.
Either my memory or my computer's is having problems, obviously,
probably the former!

You would use code SOMETHING LIKE this in the combo's AfterUpdate
event. Make it an Unbound combo box (its Control Source property
should be blank), with its bound column being the Primary Key of the
form's recordsource query; the other colums of the combo can be
whatever will allow the user to select a record logically.

Private Sub cboFindRecord_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone ' get the Form's recordset
rs.FindFirst "[ID] = " & Me!cboFindRecord
' use your primary key fieldname in place of ID
If rs.NoMatch Then
MsgBox "Record Not Found"
rs.MoveFirst
End If
Me.Bookmark = rs.Bookmark ' move to the found record
End Sub



.
 
Back
Top