V
Vel
Hello,
I've recently asked a question regarding updating a
subform based on a list box. Here's the code I came up
with, unfortunately something's wrong with the FindRecord
argument.
Private Sub cboDates_AfterUpdate()
'The purpose of this is to update 3 subforms in a
'many:many relationship with the parent form based on the
'value in the listbox cboDate. This value is actually
'the primary key for the subform, though the date is
'displayed for user friendliness.
Dim stDate As Integer
subGenOb.Visible = True
subRisk.Visible = True
subThought.Visible = True
stDate = cboDates
Forms!frmIntakes!subDetail!subGenOb!txtMSID.SetFocus
DoCmd.FindRecord stDate
Forms!frmIntakes!subDetail!subRisk!txtMSID.SetFocus
DoCmd.FindRecord stDate
Forms!frmIntakes!subDetail!subThought!txtMSID.SetFocus
DoCmd.FindRecord stDate
Forms!frmIntakes!subDetail!subGenOb!
_cboAppearance.SetFocus
subRisk.Visible = False
subThought.Visible = False
End Sub
So, what's causing the problem in my findrecord
argument? I just couldn't come up with an easier way to
execute this procedure.
I've recently asked a question regarding updating a
subform based on a list box. Here's the code I came up
with, unfortunately something's wrong with the FindRecord
argument.
Private Sub cboDates_AfterUpdate()
'The purpose of this is to update 3 subforms in a
'many:many relationship with the parent form based on the
'value in the listbox cboDate. This value is actually
'the primary key for the subform, though the date is
'displayed for user friendliness.
Dim stDate As Integer
subGenOb.Visible = True
subRisk.Visible = True
subThought.Visible = True
stDate = cboDates
Forms!frmIntakes!subDetail!subGenOb!txtMSID.SetFocus
DoCmd.FindRecord stDate
Forms!frmIntakes!subDetail!subRisk!txtMSID.SetFocus
DoCmd.FindRecord stDate
Forms!frmIntakes!subDetail!subThought!txtMSID.SetFocus
DoCmd.FindRecord stDate
Forms!frmIntakes!subDetail!subGenOb!
_cboAppearance.SetFocus
subRisk.Visible = False
subThought.Visible = False
End Sub
So, what's causing the problem in my findrecord
argument? I just couldn't come up with an easier way to
execute this procedure.