Hi,
I'm tasked to create a database which keeps track of all our active permits and when the permit fee is due. I can do all that using reports. Additionaly, I have to create two forms: one to obtain permit and second to terminate the permit. Information entered into the form to obtain the permit is used to keep track of active permits and permit fee. I'm having one heck of time getting it work.
I have created two forms both input data into a single table. First form is to obtain a permit before construction and second form is to terminate the permit at the end of construction. Second form doesn’t include all the information in the first form but majority of it is same. First form is working fine; but, I’m having a little problem getting the second form to behave the way I like. What I would like to do is select project ID from dropdown box and have most of the information entered from the table. I have tried two different approaches
1. Using two different tables, one for obtaining the permit and one to terminate e permit. In this case, I was able to recall information from the first table but wasn’t able to enter data records…it kept writing over the same record.
2. With the same table approach everything is fine, but I can’t pick project ID from dropdown box, I have to go through each record to get to the one I would like to create the notice of termination for. Is there a way, I can just pick the project ID from drop down box?
Any help I can get with this matter will be greatly appreciated.
Hi Shaffy and welcome to this forum!
Why can't you keep this within one table? if there is only a permit record per row and your field count is reasonable then a single table would be better for you.
My guess on your 'overwriting' thing you speak about that occurred when using a single table is because of your use of two forms to service one table and I am betting here that you had both forms open at the same time, causing a lock on the same table because it is the recordsource for each of your forms, so your table is in effect open in memory twice whilst editing.
I am sure you could do this project with 'one' form mounting the various fields that are needed to service the record either on the form itself or on various tab pages of a tab control mounted on one form. You might not know how to
do it but you can always hide and unhide various controls or pages of a tab control based on certain logic that you make available to your application.
Selecting an ID from a dropdown to find a record based on the ID selected is a relatively easy thing but if it were me I would consider your design with a view to amalgamating it into one form if you possibly can?.
If you can't .....well the following code if placed in the 'afterupdate' event of your unbound combobox called cboProject will place the cursor in a field called ProjectID and find a record in the current forms dataset that matches the value of the ProjectID listed in the combobox. I,ll leave you to research the meaning of the different arguments to DoCmd FindRecord 'Access help' can outline these to you
-
-
With CodeContextObject
-
DoCmd.GoToControl "ProjectID"
-
DoCmd.FindRecord .cboProject, acEntire, False, , False, , True
-
End With
-
Regards
Jim :)