R
Roger Withnell
The following code is run from a form:
Private Sub cmdSetupComplaint_Click()
Dim strSQL As String
strSQL = "SELECT Ingredients.Ingredient, " & txtSetupComplaint & " FROM
Ingredients"
strSQL = strSQL & " LEFT OUTER JOIN Complaints ON"
strSQL = strSQL & " (Ingredients.Ingredient = Complaints.Ingredient)"
strSQL = strSQL & " ORDER BY Ingredients.Ingredient"
DoCmd.OpenForm "Set up Complaint"
Forms("Set up Complaint").Caption = "Set up the Ingredient for the
Complaint: " & txtSetupComplaint
Forms("Set up Complaint")!Label22.Caption = "Set up the Ingredient for
the Complaint: " & txtSetupComplaint
Forms("Set up Complaint").RecordSource = strSQL
Forms("Set up Complaint")!Complaint.ControlSource = txtSetupComplaint
End Sub
The Form's Caption is changed to txtSetupComplaint, but Label22,
RecordSource and ControlSource do no change to the new values.
Any help very much appreciated.
Private Sub cmdSetupComplaint_Click()
Dim strSQL As String
strSQL = "SELECT Ingredients.Ingredient, " & txtSetupComplaint & " FROM
Ingredients"
strSQL = strSQL & " LEFT OUTER JOIN Complaints ON"
strSQL = strSQL & " (Ingredients.Ingredient = Complaints.Ingredient)"
strSQL = strSQL & " ORDER BY Ingredients.Ingredient"
DoCmd.OpenForm "Set up Complaint"
Forms("Set up Complaint").Caption = "Set up the Ingredient for the
Complaint: " & txtSetupComplaint
Forms("Set up Complaint")!Label22.Caption = "Set up the Ingredient for
the Complaint: " & txtSetupComplaint
Forms("Set up Complaint").RecordSource = strSQL
Forms("Set up Complaint")!Complaint.ControlSource = txtSetupComplaint
End Sub
The Form's Caption is changed to txtSetupComplaint, but Label22,
RecordSource and ControlSource do no change to the new values.
Any help very much appreciated.