mohammadagul
PrinceAtif
- Local time
- Today, 20:09
- Joined
- Mar 14, 2004
- Messages
- 298
I am using the following code to refer my active form and add new record
Pubrlic function AddRecord()
If [Screen].[ActiveForm].NAME = "InvoiceCredit" Then
DoCmd.GoToRecord , , acNewRec
End If
Else
End function
This works fine all the way till the end of my main form, but as soon as I jump to my sub form this code does not work. I tried using the following but stillnothing happens
If [Screen].[ActiveForm].NAME = "InvoiceSubform" Then
Docmd.gotocontrol “InvoiceNo”
DoCmd.GoToRecord , , acNewRec
End If
Also I tried this
If [Screen].[ActiveControl].NAME = "InvoiceSubform" Then
Docmd.gotocontrol “InvoiceNo”
DoCmd.GoToRecord , , acNewRec
End If
From my main form form the code runs just fine but from my subform it does not..
What am I doing wrong here?
Pubrlic function AddRecord()
If [Screen].[ActiveForm].NAME = "InvoiceCredit" Then
DoCmd.GoToRecord , , acNewRec
End If
Else
End function
This works fine all the way till the end of my main form, but as soon as I jump to my sub form this code does not work. I tried using the following but stillnothing happens
If [Screen].[ActiveForm].NAME = "InvoiceSubform" Then
Docmd.gotocontrol “InvoiceNo”
DoCmd.GoToRecord , , acNewRec
End If
Also I tried this
If [Screen].[ActiveControl].NAME = "InvoiceSubform" Then
Docmd.gotocontrol “InvoiceNo”
DoCmd.GoToRecord , , acNewRec
End If
From my main form form the code runs just fine but from my subform it does not..
What am I doing wrong here?