Guys, I was using Customer and Special Customer as examples, I figured it would be easier to understand with that example, rather than me explaining my two tables here.
My Database in reality is in a Prison Setting, and is used in a Special Housing Unit. When an Inmate enters we have to enter a LOT of data (like 60 fields in the table). Now when an Inmate gets released out of Special Housing Unit, back to the general population, we simply delete that record. I however have it set up where when this happens (Delete Record Event) it copies all that inmates data to a different table named History.
All of that works fine. What I am doing now, is simplifying the process of entering the data when an Inmate comes into the SHU. If they have been there, they will have a record in the history table. I added a button to the form that is used to browse the history table, titled ADMIT, so that they just browse to that inmates history record, click ADMIT and it copies all the data it needs to the main table. I do NOT copy all data, I have coded in which fields to copy over, as many are only related to that specific instance of admission.
Now, having explained all that, it works flawlessly, when they click ADMIT it creates a new record in the main table, adds in all the data required, closes my browse history form and opens the "Enter Inmate Data" Form. The ONLY problem is thatwhen the form opens, it is set on the 1st record. I want to know how to make it go to the record for the inmate we just copied over.
Now, the biggest problem is this database interface that staff use is simply a switchboard. They have no clue about how to actually run a database, they only know that they enter data in this area, and it prints reports. It would be EASY to do if the interface was an actual VB.NET Application. I tried using variables in my event handler, which erroed out.
The code I tried to use is:
Dim Record as String = Me.Number ;(PK)
That errored out, and I can only assume it is because that syntax is not supported in the access environment.
As you can see in my original post, I open the new form first, so I could reference the old form to get the values, hence the query expression Number = Me.Number. Then after the new form opens, the old one closes with the second line.
I read about the gotorecord method, but it only shows like next/previous/first/last. It doesnt show an example of how to go to a specific record utilizing the value to look for, as in a query.
Keep in mind, the record number of one table will NOT match the record number of the other. Nor will the PK's match. That is why I use Number as th reference, as it can NOT be duplicated in the main table, and is the best value to use to find the record.