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

Keeping Records in Sync with Pop-Up Text Box 1

Status
Not open for further replies.

mrgrogro

Technical User
Jan 8, 2005
58
US
I have a Access 97 form that is used on the shop floor to record the result of a series of inspections. The entire database is built on a single table. As inspections are completed, emplyees check one of two check boxes ("Safe" or "At Risk"). If the "At Risk" check box is clicked, another form will appear with a single text box requesting a description of the problem encountered. All records are in the same table and all my forms have an autonumber field. My problem is that the text field is not in sync with the the main form's record. Can anyone please help with a little code or a Macro solution? I need the pop-up form to look at the autonumber of the main form and record its text in the same record. I've already got some things going on on the "click" event so I was thinking about using the "after update" event???

Thanks so much!
 
There has to be something else going on to make this not work.

Option 1 - your form is bound to a record, and the popup autopopulates a control on the form. Result: the form knows the autonumber it is working with, and the information is written to the record at one time.

Option 2 - your form is unbound, and the popup box fills a variable that you hold until it is time to write the information. Result: the record is written to one time, and an autonumber is generated at the right moment.

Perhaps some more information about the table involved, fields, and the controls on the form and the form's usage would be of help.
 
If you try to use a pop-up form to do this, you may have a record-locking problem, because both forms would simultaneously have the same record in focus, if open at the same time

However, I think you could handle this in a single form: you could add your "problem-description" field to the main form, but set its 'visible'-property to "No".
Then use the after-update event of the "At Risk" checkbox to fire a macro to change the visible property to Yes.
Your macro should use the "SetValue" action for the item [Forms]![Name of form]![Name of field].[Visible] with the expression "Yes"

 
Thanks rubbernilly. A fellow at work helped me to the same conclusions but the work involved to let me stay on the same record required closing and reopening the main form each time "at risk" behavior was selected.

pedrox, you get the star. I'm a beginner and your idea keeps my form short (we're still using some 14" monitors in some areas of the production floor) and falls within my skill level.

I frequently feel pretty dumb with some of my questions but am comforted to have Access gurus only a question away.

Thanks to you both for responding! I really appreciate it

mrgrogro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top