Hello
After spending a lot of time figuring this out, I think it time to call on the experts. I can't make my sql work on rs(1).value. I keep on saying "object variable or block variable not set" I copied one in my module that works but won't work here. I am lost in translation.
Private Sub cmdRefreshData_Click()
On Error GoTo Err_cmdRefreshData_Click
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim strSQL As String
Dim ID As String
Dim Site As String
Dim Name As String
ID = Text7.Value
Set db = CurrentDb
strSQL = "SELECT * FROM [tblRecord] "
strSQL = strSQL & "WHERE [SID]= " & ID
Set rs = db.OpenRecordset(strSQL)
Site = rs(4).Value ' Location
Name = rs(5).Value ' SID name
'=====================
'Text7.Value = login id box
Thank you.
After spending a lot of time figuring this out, I think it time to call on the experts. I can't make my sql work on rs(1).value. I keep on saying "object variable or block variable not set" I copied one in my module that works but won't work here. I am lost in translation.
Private Sub cmdRefreshData_Click()
On Error GoTo Err_cmdRefreshData_Click
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim strSQL As String
Dim ID As String
Dim Site As String
Dim Name As String
ID = Text7.Value
Set db = CurrentDb
strSQL = "SELECT * FROM [tblRecord] "
strSQL = strSQL & "WHERE [SID]= " & ID
Set rs = db.OpenRecordset(strSQL)
Site = rs(4).Value ' Location
Name = rs(5).Value ' SID name
'=====================
'Text7.Value = login id box
Thank you.