Open a Second Form & Select a Record to Open Another Form

dgaletar

Registered User.
Local time
Today, 14:03
Joined
Feb 4, 2013
Messages
172
HELLO ALL!

My task is this:

My main form uses the CUA# (tb_CUA) as the Primary Key. (The CUA# is the number that we have assigned to a vehicle)

Also on that form is a button to open a new “Service Record” for that CUA#.

I am now trying to add another button that would open a listing of the ‘EXISTING” service records for that CUA# (vehicle), so that one of those records may be selected and then edited/printed/etc.

The code that I am using on the "View/Edit and Existing Service Record" button is this:

1. Private Sub Command856_Click()
2. DoCmd.OpenForm "SERVICE", , , "tb_CUA = " & Me.tb_CUA
3.End Sub

(NOTE: the Form "SERVICE" is simply a form that I created to list all of the services that had been performed on that vehicle. It is currently set as a "Continuous Forms", and contains a checkbox, the date, mileage, work order number, and technician for each line of service.)

The problem that I am experiencing with this form is that it is only showing all of the records for that vehicle. It won't let me select any of the records.

I have the forms Filter set to tb_CUA, and that is working fine. I also have the "Data Entry" set to No. If I change that to Yes, nothing shows up on the form.

Would you mind passing on any suggestions that you might have that might help me get over this hump???
 
Could you post your database with some sample date, (zip it)?
 
OK, there she is... in all her glory!?!

When you open the database the "Navigation" page should load. Click on "View and/or Edit All Vehicle Records" under the "General Details:" section. In the middle of the page you should see two darker blue buttons... "Add a New Record" and "View/Edit An Existing Record". The second is the one that I am having trouble with.

Also, if you don't mind, please be very detailed with your responses as I am still very new to Access, and the littlest things are tripping me up. Getting to this point was not that hard, but now I am getting tripped up all over the place.

Thanks for the help!!!
 

Attachments

You have set the property "AllowEdit" to "No" for the "Service" form, it was the main reason.
 

Attachments

But if I set it to yes, wouldn't people be able to alter the other fields as well???
 
It was suggested that I upload a sample of the database. Unfortunately, I am not able to do that as I am on a train. I have however recently uploaded a copy to another forum. The thread is located at:

http www accessforums net/access/continuation-past-due-30-60-90-a-32382/index2 html#post159398

Hope this helps! Thx
 
But if I set it to yes, wouldn't people be able to alter the other fields as well???
Which other fields, do you not want to edit the fields in the "Service" form?
If not, then you have to explain a little more what you want, because then I've misunderstood you.?
 
Good morning JHB. I'm not talking about editing the fields in the SERVICE form. All that I am trying to do is to give the end user two options; 1) to open a NEW service record for that vehicle, and 2) open an EXISTING service record for that vehicle. Option one is already working fine.

The problem is with option two. When the end user clicks on the button "View/Edit An Existing Record", I would like a listing of all of the service records for that vehicle to appear. I would then like for that user to be able to select ONLY ONE of those existing records and either view it in a report manner, or open the record up to edit it.

Right now, when you click on the "View/Edit An Existing Record" button, it opens a form named "SERVICEhistory" which I designed as a continuous form to show all of the services for that vehicle. On that form I added a checkbox. The idea is for them to be able to select (ONLY) one of the checkboxes listed and then select to "Open & Edit the Record", or to "View the Record" for print.

Does any of this make sense to you? Also, it is VERY possible that I am going about this process completely wrong. So, any and all suggestions are welcomed!

Thx!
 
BTW, since I am back at work, I am able to upload a zip of the database.
 

Attachments

You have still set the property "AllowEdit" to "No" for the "Servicehistory" form, it is the main reason. If you want to prevent change to the data, then lock it on control level.
You can't use a checkbox without controlsource, because if you tick one, all change, therefor just for now, I've set it so that you stay in the date control and then hit the botton for edit the record. Look at the "CUA"=11 to see what I'm talking about.
If you set the DataEntry to "Yes", the form open a new record, but if you also set the property "AllowEdit" to "No", an empty form open without visible controls/data in it.

I return the database with the changes I did.

Another thing I saw was, you are referring to wrong formulars and control there don't exist.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom