check boxes

M

Melissa

Hi there

I have a form with some fields on it. Now i would like to add a few check
boxes to my form. but when I check
them, they are not checked when i return to that specific record?

Please could someone assist me

thank you

Melissa
 
B

Beetle

The value of the check boxes will not be saved unless they are bound
to fields in a table.

What is the purpose of the check boxes you are adding?
 
M

Melissa

Im desiging a database for a windscreen repair company that repairs
windscreen chips

I have a form on which I select clients, vehicle details etc for the "job" -
its a "Job" form

Now, on this form I have drawn a picture of a windscreen - just like a
rectangle type shape...and I have inserted a lot of check boxes inside the
"windscreen" to indicate where the chips are located on the
windscreen, so by "ticking" the box on a certain area on the windscreen, the
user can save the location.

Melissa
 
B

Beetle

Ah yes, I saw that thread earlier. Unfortunately, as Tom said, there is
no good built in way to do that. In order to do it like you are attempting,
you would need, for example, another table with a field for each one
of your check boxes. It would need to be related to your current table
via ClientID (or whatever the PK is), an then you would probably want
to make your "wind screen" a subform.

I am *not* recommending that you do it, because it's not very good
design. For example, if you have 30 check boxes, then for every record
in this new table, you will have 29 unused fields.

But, if you are determined to proceed with it, you will need to do
something like that.
 
F

fredg

Ah yes, I saw that thread earlier. Unfortunately, as Tom said, there is
no good built in way to do that. In order to do it like you are attempting,
you would need, for example, another table with a field for each one
of your check boxes. It would need to be related to your current table
via ClientID (or whatever the PK is), an then you would probably want
to make your "wind screen" a subform.

I am *not* recommending that you do it, because it's not very good
design. For example, if you have 30 check boxes, then for every record
in this new table, you will have 29 unused fields.

But, if you are determined to proceed with it, you will need to do
something like that.

You're right, Beetle. It is cumbersome and most likely not necessary.
Perhaps two fields added to the table named "PositionLeft" and
"PositionDown".
A simple guess (or measurement of the window) to determine the chips
left and down position and then just enter those measurements into the
form fields, i.e. 6.5 and 12 (for from the left and down from the top
of the window).

If the user needs to show the position in a report, those values,
converted into Twips (1440 per inch) and reduced to Scale, can be used
to position an X at that spot in a Rectangle box in the report.

Dim ByScale = 2
LabelShowChip.Left = ([PositionLeft]*1440 +
BoxWindshield.Left)/ByScale
LabelShowChip.Top = ([PositionTop]*1440 + BoxWindshield.Top)/ByScale

The ByScale value is needed to scale the actual inches down so the x
will fit on the report page within the box. Change as needed.
LabelShowChip is a label with a "x" as it's caption.
 
M

Melissa

Thank you very much for your help. It seems to be working ok. Have you
perhaps read my thread for "combo Box" I am having trouble with my "jobs"
form. I select my client from the drop down list, and then that specific
client's vehicle reg details appear in the "VehicleReg" drop down list,
where i choose a vehicle. This works well, but then if for example I would
like to add new vehicle details for the selected client on the "jobs" form,
I click on the "add vehicles" button which takes me to the vehicles for that
specific client. However, it is not saving the new vehicle details which i
add there. i can only successfully save vehicle details in the vehicles
subform on the clients form

thank you

Melissa
 
B

Beetle

I figured there would be somebody out there smarter than me, with
a better idea.

You're brain is large, Fred :)
--
_________

Sean Bailey


fredg said:
Ah yes, I saw that thread earlier. Unfortunately, as Tom said, there is
no good built in way to do that. In order to do it like you are attempting,
you would need, for example, another table with a field for each one
of your check boxes. It would need to be related to your current table
via ClientID (or whatever the PK is), an then you would probably want
to make your "wind screen" a subform.

I am *not* recommending that you do it, because it's not very good
design. For example, if you have 30 check boxes, then for every record
in this new table, you will have 29 unused fields.

But, if you are determined to proceed with it, you will need to do
something like that.

You're right, Beetle. It is cumbersome and most likely not necessary.
Perhaps two fields added to the table named "PositionLeft" and
"PositionDown".
A simple guess (or measurement of the window) to determine the chips
left and down position and then just enter those measurements into the
form fields, i.e. 6.5 and 12 (for from the left and down from the top
of the window).

If the user needs to show the position in a report, those values,
converted into Twips (1440 per inch) and reduced to Scale, can be used
to position an X at that spot in a Rectangle box in the report.

Dim ByScale = 2
LabelShowChip.Left = ([PositionLeft]*1440 +
BoxWindshield.Left)/ByScale
LabelShowChip.Top = ([PositionTop]*1440 + BoxWindshield.Top)/ByScale

The ByScale value is needed to scale the actual inches down so the x
will fit on the report page within the box. Change as needed.
LabelShowChip is a label with a "x" as it's caption.
 
B

Beetle

I'm not sure I'm following you. When you click the 'add vehicles'
button, does it open a separate form where you add new vehicles
for the client? If that's the case, then you might just need to requery
the original form when you close the 'add' form.
 
M

Melissa

Yes, when I click "Add Vehicles" it opens the "Vehicles" form, and displays
all the vehicles for that specific client, but if I add new vehicle there,
it doesnt save it at all. I can only successfully add a new vehicle if I go
into the "Clients" form - on the Vehicles subform.

Where would i assign the macro to requery? and would i requery the
"vehicleReg" drop down?

thank you
 
R

Rick Brandt

Yes, when I click "Add Vehicles" it opens the "Vehicles" form, and
displays all the vehicles for that specific client, but if I add new
vehicle there, it doesnt save it at all. I can only successfully add a
new vehicle if I go into the "Clients" form - on the Vehicles subform.

Where would i assign the macro to requery? and would i requery the
"vehicleReg" drop down?

Sounds like you are not filling out all required fields and you have a
custom close button.

There is a long-standing bug that if you close an Access form with code
or macro and that form contains a new record that has not yet been
"legally" completed that the record is silently discarded.

Closing in that situation with the built in [X] will produce a message
indicating what is wrong with the record and give you a chance to correct
it, but not if you close from code.

Do you have hidden fields for the primary key or linking fields on the
form? While filtering your form might display all records for a specific
client that does not mean that any new records will automatically be
associated with that client. You don't get that behavior unless you use
an embedded subform.
 
M

Melissa

I do yes. The vehicles form that opens has a clientId field which is not
displayed on that form.

would i need to create a "vehicle"subform on my jobs form?

I tried using the [x] instead of the "close" command button, but it is not
displaying any errors or anything?....

thank you


Rick Brandt said:
Yes, when I click "Add Vehicles" it opens the "Vehicles" form, and
displays all the vehicles for that specific client, but if I add new
vehicle there, it doesnt save it at all. I can only successfully add a
new vehicle if I go into the "Clients" form - on the Vehicles subform.

Where would i assign the macro to requery? and would i requery the
"vehicleReg" drop down?

Sounds like you are not filling out all required fields and you have a
custom close button.

There is a long-standing bug that if you close an Access form with code
or macro and that form contains a new record that has not yet been
"legally" completed that the record is silently discarded.

Closing in that situation with the built in [X] will produce a message
indicating what is wrong with the record and give you a chance to correct
it, but not if you close from code.

Do you have hidden fields for the primary key or linking fields on the
form? While filtering your form might display all records for a specific
client that does not mean that any new records will automatically be
associated with that client. You don't get that behavior unless you use
an embedded subform.
 
M

Melissa

I have fixed the problem i think. It is working perfectly how. i can
assign new vehicles to each client using a "vehicles" subform on my "jobs
form". thank YOu

Now, also on my Jobs form, after I select "Client" from the clients
comboBox, and then select a vehicleRegNo from the vehicles dropdown list,
then go back and change the client - the VehiclesDrop down list only shows
the vehicles for the client i have just chosen which is fine, but it keeps
the text of the previously chosen client in the Vehicles drop down until i
select the one i want from the list?

Thank you to all for your help

kind Regards

Melissa


Melissa said:
I do yes. The vehicles form that opens has a clientId field which is not
displayed on that form.

would i need to create a "vehicle"subform on my jobs form?

I tried using the [x] instead of the "close" command button, but it is not
displaying any errors or anything?....

thank you


Rick Brandt said:
Yes, when I click "Add Vehicles" it opens the "Vehicles" form, and
displays all the vehicles for that specific client, but if I add new
vehicle there, it doesnt save it at all. I can only successfully add a
new vehicle if I go into the "Clients" form - on the Vehicles subform.

Where would i assign the macro to requery? and would i requery the
"vehicleReg" drop down?

Sounds like you are not filling out all required fields and you have a
custom close button.

There is a long-standing bug that if you close an Access form with code
or macro and that form contains a new record that has not yet been
"legally" completed that the record is silently discarded.

Closing in that situation with the built in [X] will produce a message
indicating what is wrong with the record and give you a chance to correct
it, but not if you close from code.

Do you have hidden fields for the primary key or linking fields on the
form? While filtering your form might display all records for a specific
client that does not mean that any new records will automatically be
associated with that client. You don't get that behavior unless you use
an embedded subform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

combo boxes 8
Check/Uncheck All, write conflict 4
Check boxes 3
Command buttons 1
Check boxes. 3
Access 2003 Data Not Saving? 0
check boxes to fill another check box 2
Employee Shift Schedules 2

Top