Code:
Option Compare Database
Private Sub cbx_UserID_BeforeUpdate(Cancel As Integer)
Call updateTextFields
End Sub
Private Sub updateTextFields()
Dim DescrSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
cbx_UserID.SetFocus
DescrSQL = "SELECT Surveys.[Duty_Pos] FROM Surveys WHERE Surveys.[User_ID]='" & cbx_UserID.Text & "';"
Set db = CurrentDb()
Set rs = db.OpenRecordset(DescrSQL)
rs.Close
db.Close
End Sub
Okay this thing keeps giving me some crap about "you must save the field before you execute" for the setfocus part.
How do I work with recordsets so I can assign the values from my query results to the other text fields??