Simple form problem

simongallop

Registered User.
Local time
Today, 18:45
Joined
Oct 17, 2000
Messages
611
I am going round in circles. I have a form which allows me to edit records in a table. I want to be able to type in the index number and then the record will show in other text boxes for me to amend. Either I get the data into the boxes but they do not update the table or I get #Name? What is the simple step that I am missing?

Frustrated

Simon
 
If I were doing this, I would create an unbound text box, which is used to type in the index of the record you want to update. Call this [txtInputIndex], say.

Now, in the OnUpdate event procedure of this text box, add the following code:

With Me
.Filter = "[MyIndex] = " & Chr(34) & .txtInputIndex & Chr(34)
.FilterOn = True
End With

NOTE: This assumes that MyIndex is a string field. If it's a number, get rid of the Chr(34)'s (they just give you " characters).

You may want to add in some extra code to validate the index that the user inputs, just in case they input one that doesn't exist. Try looking up On Error, MsgBox, and related topics in Access Help.

Good luck!
 
Spot on. Thanks v. much
 

Users who are viewing this thread

Back
Top Bottom