Dear All,
I appear to be struggling to get the OpenArgs property of a DoCmd.OpenForm statement to work. The "calling" form's code is:
The Receiving Code is:
What I am trying to do is pass the value in intuserid through to input it into the SQL statement. Please can anyone help?
Many Thanks
Graham
I appear to be struggling to get the OpenArgs property of a DoCmd.OpenForm statement to work. The "calling" form's code is:
Code:
Public Function lstUser2_Click()
Dim intuserid As Integer
intuserid = Forms!frmUsrQualSearch1.List0.Column(0)
DoCmd.OpenForm ("frmUsrQualSearch2",,,,,,intuserid)
DoCmd.Close acForm, "frmUsrQualSearch1"
End Function
The Receiving Code is:
Code:
Private Sub Form_Load()
Dim intuserid As Integer
Dim strsql As String
strsql = "SELECT tblStaffQual.StaffQualID, tblQuals.Qual_Name " & _
"FROM tblATFStaff RIGHT JOIN (tblQuals RIGHT JOIN tblStaffQual ON tblQuals.Qual_ID = tblStaffQual.ATFQual_ID) ON tblATFStaff.ATFStaffID = tblStaffQual.ATFStaff_ID " & _
"WHERE (((tblStaffQual.ATFStaff_ID)=" & intuserid & "));"
Debug.Print strsql
intuserid = Me.OpenArgs
List0.RowSourceType = "Table/Query"
List0.RowSource = strsql
End Sub
What I am trying to do is pass the value in intuserid through to input it into the SQL statement. Please can anyone help?
Many Thanks
Graham