Thanks in advance for any help. I'm trying to do something that should be simple enough but it's not working. I'm trying to display a text in a field based on a select query. If a value exists in a field in my database (LotNum in Blendsheet input), then i want my text box on a form to say "finalled". I keep getting an object required error message.
Private Sub TankNum_Change()
Dim stSql As String
Dim rs As Object
Dim con As Object
Dim lotn As Variant
Set con = Application.CurrentProject.Connection
stSql = "Select [LotNum] FROM [Blendsheet Input] as lotn"
stSql = stSql & " WHERE [TankNum] = '" & cboTankNum.Value & "'"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1
TxtStatus.SetFocus
lotn = Me![LotNum]
If lotn Is Null Then
TxtStatus.Text = ("Not Finalled")
End If
If lotn = True Then
TxtStatus.Text = ("Finalled")
End If
Exit_Close_Click:
Exit Sub
End Sub
Private Sub TankNum_Change()
Dim stSql As String
Dim rs As Object
Dim con As Object
Dim lotn As Variant
Set con = Application.CurrentProject.Connection
stSql = "Select [LotNum] FROM [Blendsheet Input] as lotn"
stSql = stSql & " WHERE [TankNum] = '" & cboTankNum.Value & "'"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1
TxtStatus.SetFocus
lotn = Me![LotNum]
If lotn Is Null Then
TxtStatus.Text = ("Not Finalled")
End If
If lotn = True Then
TxtStatus.Text = ("Finalled")
End If
Exit_Close_Click:
Exit Sub
End Sub