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

text box query

Status
Not open for further replies.

Marcus9

Programmer
Jan 5, 2001
7
GB
This is probebly a really simple question but here goes:

I've designed a form to update records in a database. This works fine. However I want the text box to remember the previous entry the user made so that it doesn't need typing in each time. Since some of the data remains constant for a few entries.

Thanks? please help!
 
Hi!

One way to do it, and there may be easier ways since this is just off the top of my head, would be to store the value in the tag property of the text boxes like this:

Private Sub Form_BeforeUpdate(Cancel as Integer)

YourControlName.Tag = YourControlName.Value
YourNextControl.Tag = YourNextControl.Value
Etc.

End Sub

Then, in the form current event you reverse the process, checking that the controls are empty first:

Private Sub Form_Current

If IsNull(YourControlName) = False Then
YourControlName = YourControlName.Tag
End If
Etc.

This will store the previous values automatically.

hth
Jeff Bridgham
 
Thanks,

I think that's got me looking in the right area: it sets a default the first time you enter a value. However, after you add a record, it still clears the input boxes. Also, if you try and submit the same data in the list box input as the previous entry, The error "you can't go to the specified record" comes up!!??


Any more suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top