Log in

View Full Version : Open args and tick boxes with forms



OTWarrior
11-15-2007, 05:45 AM
I am trying to send the value of 2 tick boxes from a form to the next form that loads using open args, yet I am unable to gte my code to work.

the tick boxes are boolHasPets and boolSmoker, these names are consistant throughout the multiple forms.

form 1:

DoCmd.OpenForm "frm_AddBooking", , , "[nID]=" & Me.nID, acFormAdd, , Me.boolHasPets & Me.boolSmoker


form 2 (on load):

Dim strHasPets As Boolean
Dim strSmoker As Boolean
Dim ArrOpenArgs As Variable

ArrOpenArgs = Split(Me.OpenArgs, ",")
strHasPets = ArrOpenArgs(0)
Me.boolHasPets = strHasPets
strSmoker = ArrOpenArgs(1)
Me.boolSmoker = strSmoker

I know this is wrong, but I am unsure of how to go from here, as I have tried many variation (even using the openargs value as a string and spliting it)

Any advice?

akn112
11-15-2007, 06:10 AM
if you are using

ArrOpenArgs = Split(Me.OpenArgs, ",")

then ur delimiter is a comma, u should use openargs like this


DoCmd.OpenForm "frm_AddBooking", , , "[nID]=" & Me.nID, acFormAdd, , Me.boolHasPets & "," & Me.boolSmoker

akn112
11-15-2007, 06:10 AM
when using, i also dim my variable as variant