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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically fill in field

Status
Not open for further replies.

taylornow

Technical User
Oct 16, 2000
90
US
Is there a way to automatically fill in a field when another field is keyed? Example - the county automatically enters when the city is keyed in. Possilbe??

Thanks in advance
Taylor
 
The Dlookup function in the field on your form to be filled automatically works well for this.


Dave
 
When you design a database, you can create a column, and to put in DefaultValue your expression.
for example table has columns ID, xx, yy and you want the field zz=xx+yy. You just add this column in design mode and in DefaultValue put xx+yy. John Fill
 
Using the after update event of the text box, you can assign a value to another control:

Private Sub Zip_AfterUpdate()
Me.State = DLookup("ST", "Z5LL", "[Zip] = '" & Me.Zip & "'")
Me.City = DLookup("City", "Z5LL", "[Zip] = '" & Me.Zip & "'")
Me.Refresh
End Sub Mike Rohde
rohdem@marshallengines.com
 
Thanks a bunch everybody- I shall give it a go !
 
I just tried to do as I sayd, but it doesn't work. Instead it you can just use a query
select xx,yy,(xx+yy) as zz from tablex. zz will be always autoupdatable. John Fill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top