Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling through records does not immediately show address. 1

Status
Not open for further replies.

KavJack

Programmer
Apr 1, 2001
46
0
0
I have the following code in a Form :
Private Sub Client_Bldg___Change()

Dim Client_No As Variant
Dim Client_Addr1 As Variant
Dim strCity, strState, strZip, strCrit As Variant

If Left(Me.Client_Bldg__, 1) = "1" Then
Client_No = 1
Me.Client_Internal__ = Client_No
End If

strCrit = "Client_Bldg_No = """ & Me.Client_Bldg__ & """"
Me.Text92 = DLookup("Project_Address", "tblBuildings", strCrit)

strCity = DLookup("Project_City", "tblBuildings", strCrit)
strState = DLookup("Project_St", "tblBuildings", strCrit)
strZip = DLookup("Project_Zip", "tblBuildings", strCrit)

If Len(Nz(strCity, 1)) < 2 Then
str01 = ""
Else
If Len(Nz(strState, 1)) > 1 Then
str01 = strCity & ", " & strState & " "
Else
str01 = strCity
End If
End If

Me.Text94 = str01 & strZip
Me.Refresh

End Sub

This code is supposed to take a particular Project building number and display the Buildings address in Text92 and the City,State, and Zip in Text94. The code works sometimes but it doesn't seem to respond in other cases when I am scrolling through the records in the Projects Table upon which the Form is built. The Projects Table is tblProjects which contains a Client Building Number field. The Buildings table is tblBuildings and contains a list of all the building numbers with their associaeted addresses.
There seems to be some kind of delay happening in the Text92 and Text94 fields being displayed. I want the display of these two text boxes to be instantaneous. Any advice here ?
 
No code in the Current event procedure of the form ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks,
I figured I was missing an Event Trigger somewhere but I couldn't figure out where ? I was concentrating on the field itself - forgot about the Form detail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top