M
Max Yaffe
I'm trying to implement multiple forms as per the "Access 2002 Devel.
Handbook" by Letwin, et.al. Here's my code to create a new form:
Public Sub NewBuycard(myPart As String)
Dim frm As Form_frmBuyCard
Set frm = New Form_frmBuyCard
' Do some bookkeeping here so form doesn't disappear at End Sub
...
frm.Visible = True
End Sub
This works fine (Thanks guys). It triggers the Form_Open code with
Me.OpenArgs set to Null which I show here:
Private Sub Form_Open(Cancel As Integer)
Dim S As String
If IsNull(Me.OpenArgs) Then
Me.Openargs = <some default value>
End If
' Do something with OpenArgs here
SetPart (Me.OpenArgs)
End Sub
But I'd really like to create a parameterized form in which OpenArgs
is set correctly. Ideally there should be something like
Set frm = New Form_frmBuyCard myPart
which would call Form_Open with OpenArgs set to myPart. Alas, that
doesn't work.
Is there any way I can have my cake and eat it too?
Thanks,
Max
Handbook" by Letwin, et.al. Here's my code to create a new form:
Public Sub NewBuycard(myPart As String)
Dim frm As Form_frmBuyCard
Set frm = New Form_frmBuyCard
' Do some bookkeeping here so form doesn't disappear at End Sub
...
frm.Visible = True
End Sub
This works fine (Thanks guys). It triggers the Form_Open code with
Me.OpenArgs set to Null which I show here:
Private Sub Form_Open(Cancel As Integer)
Dim S As String
If IsNull(Me.OpenArgs) Then
Me.Openargs = <some default value>
End If
' Do something with OpenArgs here
SetPart (Me.OpenArgs)
End Sub
But I'd really like to create a parameterized form in which OpenArgs
is set correctly. Ideally there should be something like
Set frm = New Form_frmBuyCard myPart
which would call Form_Open with OpenArgs set to myPart. Alas, that
doesn't work.
Is there any way I can have my cake and eat it too?
Thanks,
Max