Hello, I have a "data entry form" with several text boxes and list boxes, combo boxes.The user is suppose to select a student first name from a combo box and a last name from another combo box and the Student_Id textbox should be updated after the user made the selections. I have written the code below but it does not seem to work properly. Can someone help? Thanks in advance.
[code= vb]
Private Sub txtStudent_ID_A fterUpdate(Canc el As Integer)
With Me![txtStudent_ID]
If IsNull(Me!cmbFi rst_Name) & IsNull(Me!cmbLa st_Name) Then
.RowSource = ""
Else
.RowSource = "SELECT [FirstName] & [LastName]" & _
"FROM tblSpecialist " & _
"WHERE [Student_ID]=" & Me!txtStudent_I D
End If
Call .Requery
End With
End Sub
[/End]
[code= vb]
Private Sub txtStudent_ID_A fterUpdate(Canc el As Integer)
With Me![txtStudent_ID]
If IsNull(Me!cmbFi rst_Name) & IsNull(Me!cmbLa st_Name) Then
.RowSource = ""
Else
.RowSource = "SELECT [FirstName] & [LastName]" & _
"FROM tblSpecialist " & _
"WHERE [Student_ID]=" & Me!txtStudent_I D
End If
Call .Requery
End With
End Sub
[/End]
Comment