hello all, two things, firstly, i would like to start my program and go through it step by step using the debugger. from that i can hopefully see what is going wrong and what my variables contain at each point throughout my program.
my problem is this:
under General of main form i have a variable declared as:
Public lngLastFocus As Long
then a small procedure in main section:
so on the click of the button on main form it should go to the current record they have selected. this only works if its record 1, if they choose record 2 or 3 etc then it crash's with runtime error 2105.
if i debug, the value in acGoTo = 4, the value in lngLastFocus = (the number of the record i was looking at(which is correct)). so what can i do to make this acgoto thing behave like it should, why is it pointing at number 4? i really am baffled.
thank you for any help. i have attached program for you guys to have a look if you would be so kind.
(program does as it should for "workstation ip address" button, yet not for any others, same code. relationships same too (i think)).
my problem is this:
under General of main form i have a variable declared as:
Public lngLastFocus As Long
then a small procedure in main section:
Code:
Private Sub WorkStationSoftwareOpen_Click()
DoCmd.OpenForm "frmIMBUIPAddresses", acNormal, "", "", acEdit, acWindowNormal
lngLastFocus = Me.CurrentRecord
If lngLastFocus <> 0 Then
DoCmd.GoToRecord , , acGoTo, lngLastFocus
End If
DoCmd.Close acForm, Me.Name
End Sub
so on the click of the button on main form it should go to the current record they have selected. this only works if its record 1, if they choose record 2 or 3 etc then it crash's with runtime error 2105.
if i debug, the value in acGoTo = 4, the value in lngLastFocus = (the number of the record i was looking at(which is correct)). so what can i do to make this acgoto thing behave like it should, why is it pointing at number 4? i really am baffled.
thank you for any help. i have attached program for you guys to have a look if you would be so kind.
(program does as it should for "workstation ip address" button, yet not for any others, same code. relationships same too (i think)).