Help needed - query on a form

aerodolphin

New member
Local time
Today, 02:20
Joined
Aug 26, 2009
Messages
5
Hello,

I need that database working, but I'm having some issues. I tryed a lot of things. I waste a lot of time and no success. Please help. I think is simple for who knows how to do it.

TABLES PRESENTED ON THE DATABASE

WHEELS (ID, PN, SN, OH_CYCLE)
OH_CONTROL (ID, PN, OH_CYCLE, ACTION, CONDITION)

SIMPLE EXPLANATION OF MY DATABASE

I have a table [WHEELS] with a list of wheels. There I included too the number of overhauls (field OH_CYCLE).

I have another table [OH_CONTROL] that have a list of (OH_CYCLE) numbers and the corresponding action/condition. In other words.

The wheels need a different type of inspection in accordance with that list on the [OH_CONTROL] table.

So, I have 2 forms:

- WHEEL CONTROL: We should run this form first. Here we insert the P/N and S/N of the Wheel. And the system give us the
information about the O/H cycles for that specific wheel. When we click on the "NEW OVERHAUL" button, the system runs a MACRO
that adds 1 more O/H cycle to the table [WHEELS] and then opens the next form.

- NDT CONTROL POP UP: Here appears one more time the P/N and S/N of the selected wheel. Appears the actual O/H cycle updated with
+1 from the macro before. And I need to get that value (from O/H CYCLE) and use it to display the message on the [Lista26] box.

THE PROBLEM
On the NDT CONTROL POP UP form I'm having difficulties in get the value from [OH_CYCLES_BOX] and use it to display the message of
the action/condition to do on the [Lista26] box.

I will need a query or use another function to select the condition field of the table [OH_CONTROL] where the P/N and OH_Cycle
match.

POSSIBLE SOLUTIONS
I tryed the DLookup() function but without success.

Please, someone can give me a help. Thank you.
 

Attachments

I can't open your DB at the moment, don't have 2007 on this computer.... But, First thing I see is your table structure.
WHEELS (ID, PN, SN, OH_CYCLE)
OH_CONTROL (ID, PN, OH_CYCLE, ACTION, CONDITION)
First, I would not use spaces....they get you into trouble.
tblWheels (WheelsID, PN, SN, OhCycleID)
tblOhControl (OhCycleID, Action, Condition)
And it sounds like there should be a "one to many" on OhCycleID.
Try that, and see if it helps.
 
Tks Curtis, I don't have spaces. I have _ instead of spaces.

I cannot have the "one to many" relation on OhCycleID. It's better to have some help from some one that can open the 2007 database. It's difficult to explain more without see it.
 
I'll open it when I get home. But no matter what version you use the table structure is still incorrect. You have duplicate fields.
 
I'll open it when I get home. But no matter what version you use the table structure is still incorrect. You have duplicate fields.

Are you able to save it in the .mdb format? Then it should be readable by other versions of MS Access.
 
Well, after opening the DB, it makes little sense to me.... Maybe someone else can take a shot at this... BUT... A couple things first....again.... Normalize the database. Look at the relationships... With this sentence......
"I have a table [WHEELS] with a list of wheels. There I included too the number of overhauls (field OH_CYCLE)" This implies a one (WHEELS) to many (OH_CYCLE) to me....
And "I have another table [OH_CONTROL] that have a list of (OH_CYCLE) numbers and the corresponding action/condition" And this one implies a one (OH_CONTROL) to many (OH_CYCLE)
And you normalize the DB... and build some queries (I would base your forms on queries,not tables) then build your forms. You might find it will work the ay you want it to.....
 
Here is the database for other versions of Access.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom