Not sure how to proceed? (1 Viewer)

B1TZMAST3R

New member
Local time
Today, 05:58
Joined
Sep 8, 2003
Messages
6
I am developing an outside service database. I have two tables...Customer Info & Equipment.

A Customer Info form contains a Tab Control with 5 tabs. Each tab displaying information for one machine using an equipment subform bound to a Model# field. The subforms work great using the Model # info.

My problem is, I need to use the Serial number to pull the correct records into these subforms. I understand how to link the subform if the serial number was an EXACT match, but the equipment info is determined by the serial number prefix.
An Example would be...
two machines with the same model (EP50) will need different parts determined by the serial number prefix (LX123 or GA123).

Basically each subform needs to match the Model # then display the proper equipment record by comparing the first two characters of the Serial # field, ignoring the rest of the serial number.

I am stumped! I think I'll have to write some code...However, I'm not sure where to place it. Not to mention I'm new to Visual Basic.

Any help anyone can offer would be GREATLY APPRECIATED!

Thanks
B1TZM@ST3R
 

WayneRyan

AWF VIP
Local time
Today, 13:58
Joined
Nov 19, 2002
Messages
7,122
B1,

You need criteria like: Mid(SerialNumber,1,2) & Me.ModelNumber.

Wayne
 

B1TZMAST3R

New member
Local time
Today, 05:58
Joined
Sep 8, 2003
Messages
6
???

Forgive me...Your explination went clean over my head.

can you please elaborate?

Thanks
 

WayneRyan

AWF VIP
Local time
Today, 13:58
Joined
Nov 19, 2002
Messages
7,122
B1,

An Example would be...
two machines with the same model (EP50) will need different parts determined by the serial number prefix (LX123 or GA123).

Where'd the 123 come from? The LX and GA are the first two
characters of the serial number.

I assume that you used the Master-Child method to link your
forms. I don't recall ever seeing a "calculated" link, so I think
that you are going to have to use a query. You can base
your subform on a query, and the query will probably have
a criteria somewhat like:

Like Mid(Forms![YourMainForm]![SerialNumber, 1, 2) & "*"

Then you will have to do a:

Forms![YourMainForm]![YourSubForm].Requery

When your main form changes records. (OnCurrent event).

Wayne
 

Users who are viewing this thread

Top Bottom