G
Guest
I am trying to update a textbox on gotfocus but the query is complex, so it
would be easier to use sql then a DLookup.
Can anyone tell me why no value shows up on focus
Private Sub File_GotFocus()
Dim sqlText As String
sqlText = "SELECT County_TownFileNo.FileNo FROM County_TownFileNo INNER JOIN
LocalEntity ON County_TownFileNo.Town = LocalEntity.LocalEntityName WHERE
(((LocalEntity.County)=Mid([Forms]![OrdersUnbound]![Section],3,2)) AND
((LocalEntity.EntityNum)=Right([Forms]![OrdersUnbound]![Section],2)));"
'check to make sure form is being filled out
If Me!FlagEdited = 1 Then
Me.File.ControlSource = sqlText
Me.File.Requery
End If
End Sub
Any Help is greatly appreciated
would be easier to use sql then a DLookup.
Can anyone tell me why no value shows up on focus
Private Sub File_GotFocus()
Dim sqlText As String
sqlText = "SELECT County_TownFileNo.FileNo FROM County_TownFileNo INNER JOIN
LocalEntity ON County_TownFileNo.Town = LocalEntity.LocalEntityName WHERE
(((LocalEntity.County)=Mid([Forms]![OrdersUnbound]![Section],3,2)) AND
((LocalEntity.EntityNum)=Right([Forms]![OrdersUnbound]![Section],2)));"
'check to make sure form is being filled out
If Me!FlagEdited = 1 Then
Me.File.ControlSource = sqlText
Me.File.Requery
End If
End Sub
Any Help is greatly appreciated