I have the following code:
With CodeContextObject
.cboPostCode.Visible = False
.cmdGrout.Visible = True
.cmdAddTileProduct.Visible = True
.txtCustomerID.Visible = True
.txtSurname.Visible = True
DoCmd.GoToControl "txtSurname"
DoCmd.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
DoCmd.GoToControl "txtCustomerID"
DoCmd.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
.lstDetails.Visible = False
End With
I am trying to edit it so I get rid of all the DoCmd in the middle and came up with this coding
With CodeContextObject
.cboPostCode.Visible = False
.cmdGrout.Visible = True
.cmdAddTileProduct.Visible = True
.txtCustomerID.Visible = True
.txtSurname.Visible = True
With DoCmd
.GoToControl "txtSurname"
.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
.GoToControl "txtCustomerID"
.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
End With
.lstDetails.Visible = False
End With
However by doing this I get an error on this line:
.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
Where have I gone wrong?
With CodeContextObject
.cboPostCode.Visible = False
.cmdGrout.Visible = True
.cmdAddTileProduct.Visible = True
.txtCustomerID.Visible = True
.txtSurname.Visible = True
DoCmd.GoToControl "txtSurname"
DoCmd.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
DoCmd.GoToControl "txtCustomerID"
DoCmd.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
.lstDetails.Visible = False
End With
I am trying to edit it so I get rid of all the DoCmd in the middle and came up with this coding
With CodeContextObject
.cboPostCode.Visible = False
.cmdGrout.Visible = True
.cmdAddTileProduct.Visible = True
.txtCustomerID.Visible = True
.txtSurname.Visible = True
With DoCmd
.GoToControl "txtSurname"
.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
.GoToControl "txtCustomerID"
.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
End With
.lstDetails.Visible = False
End With
However by doing this I get an error on this line:
.FindRecord .lstDetails, acEntire, False, , False, acCurrent, True
Where have I gone wrong?