Hello all,
I followed this:
http://www.fmsinc.com/microsoftaccess/Forms/openargs/index.htm
which works perfectly, but When I want to add 3rd value or in the future potentially 4th, I'm struggling with code.
Can anyone advice please.
This is button command in form:
This in my report:
The first value works ok.
The second combines 2nd and 3rd entries
The third one shows half on second entry and entire 3rd entry
Thank you
I followed this:
http://www.fmsinc.com/microsoftaccess/Forms/openargs/index.htm
which works perfectly, but When I want to add 3rd value or in the future potentially 4th, I'm struggling with code.
Can anyone advice please.
This is button command in form:
Code:
Private Sub Command268_Click()
Dim entry1 As String
Dim entry2 As String
Dim entry3 As String
entry1 = "QA Trigger " & Date
entry2 = InputBox("Enter 1st Comment")
entry3 = InputBox("Enter 2nd Comment")
DoCmd.OpenReport "R_DailyTEST", View:=acViewPreview, OpenArgs:=entry1 & "|" & entry2 & "|" & entry3
End Sub
This in my report:
Code:
Private Sub Report_Load()
Dim intPos As Integer
Dim entry1 As String
Dim entry2 As String
Dim entry3 As String
If Len(Me.OpenArgs) > 0 Then
' Position of the pipe
intPos = InStr(Me.OpenArgs, "|")
If intPos > 0 Then
entry1 = Left$(Me.OpenArgs, intPos - 1)
entry2 = Mid$(Me.OpenArgs, intPos + 1)
entry3 = Right$(Me.OpenArgs, intPos - 1)
' Assign the value to the control
Me.txtTitle = entry1
Me.txt1 = entry2
Me.txt2 = entry3
End If
End If
End Sub
The first value works ok.
The second combines 2nd and 3rd entries
The third one shows half on second entry and entire 3rd entry
Thank you