MadeCurler
enthusiastic pensioner
- Local time
- Today, 22:50
- Joined
- Dec 6, 2007
- Messages
- 49
I've been playing around with VBA and need some help. The procedure below works when I pass the value of "CboWhereTo" from a list box on a form via a Button's click event.
Public Sub WhereToNow(CboWhereTo)
If [CboWhereTo] = "Address & Domain" Then
DoCmd.OpenForm "FrmAddressDomain",acNormal
End If
I want the Form ("Address & Domain") to open at a specific record (say 125 of 600, and still show records from 125 to 600)and I've tried passing another argument to the sub (to tell it which record to open at) as below;
Public Sub WhereToNow(CboWhereTo as String,NewRecord as Integer) but when I call the procedure from the the Button's click procedure I get an error saying "expected expression or =".
I've tried all the usual places but I'm now turning to you as a last resort (as usual)...How do I pass two arguments to a procedure?? Thanks in advance.
Happy Christmas Bill Baird
Public Sub WhereToNow(CboWhereTo)
If [CboWhereTo] = "Address & Domain" Then
DoCmd.OpenForm "FrmAddressDomain",acNormal
End If
I want the Form ("Address & Domain") to open at a specific record (say 125 of 600, and still show records from 125 to 600)and I've tried passing another argument to the sub (to tell it which record to open at) as below;
Public Sub WhereToNow(CboWhereTo as String,NewRecord as Integer) but when I call the procedure from the the Button's click procedure I get an error saying "expected expression or =".
I've tried all the usual places but I'm now turning to you as a last resort (as usual)...How do I pass two arguments to a procedure?? Thanks in advance.
Happy Christmas Bill Baird