C
Costa Zu
How do I retrieve the record number in a form using a button in a sub
form?
I'm trying to:
Private Sub SelectModel(SelectedModel)
Dim CurrentModel As Long
Dim text As String
' do something with the current model
CurrentModel = frmMaster.CurrentRecord
text = Str(CurrentModel)
MsgBox (text)
' then goto the model requested
DoCmd.GoToRecord acDataForm, "Master", acGoTo, SelectedModel
End Sub
but I get the message: "Object variable or With block variable not
set".
I have the following code in the general declarations section:
Option Compare Database
Dim frmMaster As Form_Master
Dim SelectedModel As Long
Help greatly appreciated,
Regards
Costa
form?
I'm trying to:
Private Sub SelectModel(SelectedModel)
Dim CurrentModel As Long
Dim text As String
' do something with the current model
CurrentModel = frmMaster.CurrentRecord
text = Str(CurrentModel)
MsgBox (text)
' then goto the model requested
DoCmd.GoToRecord acDataForm, "Master", acGoTo, SelectedModel
End Sub
but I get the message: "Object variable or With block variable not
set".
I have the following code in the general declarations section:
Option Compare Database
Dim frmMaster As Form_Master
Dim SelectedModel As Long
Help greatly appreciated,
Regards
Costa