Kennelbloke
Technical User
I have used this process many times before but I'm can't get this to work
main form:
(button click event) ...
strSexVal = 2
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "frmPetDetails2", acNormal, , , acFormAdd, , Me!PetID & "|" & strSexVal
frmPetDetails2 form:
Private Sub Form_Load()
Public varPrevPet As Variant
Public varWhichSex As Variant
varPrevPet = Split([me.OpenArgs], "|")(0)
varWhichSex = Split([me.OpenArgs], "|")(1)
End Sub
However I keep getting a runtime error 2465 ."can't find the field '|2' referred to in your expression" when trying to Split.
Debug on frmPetDetails2 openargs shows 47418|2. I've tried "|" (pipe), semicolon etc same result.
I have decompiled and even created a new DB just in case of corruption. Got no hair left, this should be simple...
main form:
(button click event) ...
strSexVal = 2
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "frmPetDetails2", acNormal, , , acFormAdd, , Me!PetID & "|" & strSexVal
frmPetDetails2 form:
Private Sub Form_Load()
Public varPrevPet As Variant
Public varWhichSex As Variant
varPrevPet = Split([me.OpenArgs], "|")(0)
varWhichSex = Split([me.OpenArgs], "|")(1)
End Sub
However I keep getting a runtime error 2465 ."can't find the field '|2' referred to in your expression" when trying to Split.
Debug on frmPetDetails2 openargs shows 47418|2. I've tried "|" (pipe), semicolon etc same result.
I have decompiled and even created a new DB just in case of corruption. Got no hair left, this should be simple...