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

Manipulating data between 2 tables using forms

Status
Not open for further replies.

SMHSleepy

Technical User
Sep 8, 2009
174
CA
Hello all, looking for some help from the pros on this one:

I have tblBooking with only a few fields: BookingID (autonumber, primary key), LName, FName, RecDate, StudyDone (Yes/No)
I made a simple form which allows our booking staff to enter the data each time they receive a requisition for a study to be performed. This is saved as a front end db on the booking staff computer.

I also have tblMain which contains LName, FName, RecDate, and StudyDone as well as other fields.
First I made qryBooking to filter out any records where StudyDone is "Yes".
Then I made frmMain, which will be used by the technologist who performs the study. I made LName a combo box which looks up data from qryBooking (therefore shows only those records where StudyDone is "No"). When the user selects the record, it automatically fills in LName, FName, and RecDate. I did this using the me.fieldname = combo.column(#) trick - works well. Now here's the part I need help on:

Once the record is selected (and therefore a study has been done), I'd like to have tblBooking.StudyDone checked "Yes". This serves 2 purposes. First, the user won't be able to select the same record twice. Secondly, I can query tblBooking periodically to see if there are any outstanding records which haven't been studied and may have fell through the cracks.

One problem I can foresee with a simplistic solution is if the frmMain user accidently selects the wrong record and then changes it to the correct one later. If the wrongly selected record had StudyDone checked as "Yes", then it should get reversed back to "No" when the error gets corrected.

I hope this makes sense. I realize that this db structure is not ideal but I've inherited the data from a Word table and have to make due with what I got.

Any suggestions?
 
I just solved this on my own by thinking how I wanted it done step by step in my head, then finding the coding to do it. It was just a matter of calling the second form to the specific record, changing the parameter, then closing the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top