Hi, I tired posting this in the access forms section.. but got no response.. maybe I posted in the wrong forum anyways.. heres my problem..
I keep on getting an error ... compile error : invalid qualifier... on my second form..
my 2nd form is called.. "frmAddInspec" with 3 text fields "Text1,Text2.Text3" all string
My first form.. the values that I want over on my second form are..
"Project,Area,Reference"
My code behind the cmd button of first form is..
code:--------------------------------------------------------------------------------
Private Sub Command11_Click()
DoCmd.OpenForm "frmAddInspec", OpenArgs:=Project & ";" & Area & ";" & Reference
End Sub
--------------------------------------------------------------------------------
My code for my second form.. in the open event handler is...
code:--------------------------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
Dim Project As String
Dim Area As String
Dim Reference As String
Dim Iloc1 As Integer
Dim iLoc2 As String
Dim strArgs As String
Dim Text1, Text2, Text3 As String
strArgs = Me.OpenArgs & ""
If Len(strArgs) > 0 Then
Iloc1 = InStr(strArgs, ";"
If Iloc1 > 0 Then
Project = Left$(strArgs, Iloc1 - 1)
Text1.Text = Project
iLoc2 = InStr(Iloc1 + 1, strArgs, ";"
Area = Mid$(strArgs, Iloc1 + 1, iLoc2 - Iloc1 - 1)
Text2.Text = Area
Reference = Mid$(strArgs, iLoc2 + 1)
Text3.Text = Reference //////////////// error here
End If
End If
End Sub
--------------------------------------------------------------------------------
Any ideas what I'm doing wrong..
Thanks
I keep on getting an error ... compile error : invalid qualifier... on my second form..
my 2nd form is called.. "frmAddInspec" with 3 text fields "Text1,Text2.Text3" all string
My first form.. the values that I want over on my second form are..
"Project,Area,Reference"
My code behind the cmd button of first form is..
code:--------------------------------------------------------------------------------
Private Sub Command11_Click()
DoCmd.OpenForm "frmAddInspec", OpenArgs:=Project & ";" & Area & ";" & Reference
End Sub
--------------------------------------------------------------------------------
My code for my second form.. in the open event handler is...
code:--------------------------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
Dim Project As String
Dim Area As String
Dim Reference As String
Dim Iloc1 As Integer
Dim iLoc2 As String
Dim strArgs As String
Dim Text1, Text2, Text3 As String
strArgs = Me.OpenArgs & ""
If Len(strArgs) > 0 Then
Iloc1 = InStr(strArgs, ";"
If Iloc1 > 0 Then
Project = Left$(strArgs, Iloc1 - 1)
Text1.Text = Project
iLoc2 = InStr(Iloc1 + 1, strArgs, ";"
Area = Mid$(strArgs, Iloc1 + 1, iLoc2 - Iloc1 - 1)
Text2.Text = Area
Reference = Mid$(strArgs, iLoc2 + 1)
Text3.Text = Reference //////////////// error here
End If
End If
End Sub
--------------------------------------------------------------------------------
Any ideas what I'm doing wrong..
Thanks