Open data from table in VB code, then display output in report

bejammin

New member
Local time
Today, 15:05
Joined
Sep 15, 2005
Messages
5
I have a table that has fields: ID NO (Autonumber), A(checkbox), B(checkbox) and C(checkbox), with many hundreds of records.

I have a report based on a query for this table, that selects a particular record based on the user entering the desired ID NO.

In my VB code for this report, i want to analyse the data in the record selected by the ID NO and add text to a string based on logic tests of this data.

I then want to display this text onscreen in a textbox, probably by defining a function as the boxes controlsource and setting the function equal to my string.

The finished product would then run as follows: The report would open, the user would be asked to enter ID NO. Say the user enters "3" and in the record with ID NO "3", boxes A&C are ticked. The text "A and C" is displayed in the report.

Is this possible? I have been able to get this to work in a simple test database with one record, but have been unable to select a record in a larger database based on the entry of an ID NO in the report.

Any help with this would be fantastic,
Cheers,
Ben
 
Ever hear of the tables container. It has that information.

This sounds like a college course homework problem. Someone may answer those, but not me.

Good luck
 
I'm not entirely sure I understand - I can't use a table to put the information in directly. I'm writing a database that diplays and prints reports that display the maintenance licences for the helicopter pilots at my base. The secretary uses a form to update pilot information.

ID No is a stamp no. referring to the particular pilot and they can hold an A, B1 or C licence depending on the maintenance work they're allowed to carry out. You can hold any combination of the 3.

The secretary said she wanted to just be able to tick boxes for their licence no on a form, but on their printed clearance certificate, she wants it to say "A and B" or "A, B1 and C" rather than having checkboxes.

I would just have a specific output for each of the 7 combs. but she also wants to do a similar thing for helicopter type of which there are 7 - which would result in 127 combs.

As i've said i've managed to get it to display a text string in a report, based on checkboxes ticked. However, the report data is selected by ID No and i haven't been able to link this in my code to the record selected for logic testing. It always displays the text for the first record in the table, regardless of the ID no entered for the record.

The only way i can think to do this is to have a separate table called "Identifier" which just has one field ID No, that is linked in a relationship to the table with the licences details in. When the user enters an ID no for the record, that is the number that goes into the table "Identifier" and then queries can be used to pick out the correct record for testing and display in the record.

I just thought that using a separate table as a kind of variable was a little cumbersome and thought there might be a way to code this better. If not, i'll just have to tell the secretary she can just type in the licences the pilots have.

Cheers,
Ben
 

Users who are viewing this thread

Back
Top Bottom