help with yes/no feature

scottappleford

Registered User.
Local time
Today, 16:23
Joined
Dec 10, 2002
Messages
134
Hi

I am trying to get my db to open another form only when I untick the yes/no feature and then the form that loads is to find the record that has been unticked. I am running an archive register and when a box leaves the archive I un tick the box so it is not registered as archived. The form that opens is used for entering data on where the box has gone etc.

Thanks
 
In the click event of the check box
dim strLinkCriteria
If checkbox=false then
strLinkCriteria="[YourID]=" & me!YourID
DoCmd.Openform "yourformname", ,strLinkCriteria
endif

the strLinkCriteria filters the new form to only display the current record from the form you are unticking the checkbox on. YourID is the name of the unique identifier field in your tables.

Let me know if this doesn't make sense and I'll get you an example
 
Still need some help

Thanks for your reply.

I enterer the code but it says the variable is not defined and highlights checkbox.

I also maybe did not explain myself properly. Each box belongs to a contract number and to make the record unique it has to be contract number, box number. Both these fields are in the same table.

So I have tblbox number with its fields in one form and when I untick the checkbox it opens a form "frmlocation" which as the contract number, box number and checkbox fields from the previous form in it i.e from tbl box number and then a sub form form a different tbl for the location of the box details.

As I asked before i would like the form to open with the record I just unticked.

Many Thanks

scott
 
You need to replace "checkbox" in the code with the name of the checkbox control on your form. Also, to clarify, YourID should be replaced with the name of the ID field that uniquely identifies your the record. Let me know if you have any more problems and I can help you with the code. It should work if all of the fields/controls are referred to properly.
 

Users who are viewing this thread

Back
Top Bottom