View Single Post
  #5  
Old May 10th, 2010, 05:57 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Quote Form With Options - Repost

If a job may have several quotes, quote information should be in a related
table:

tblJob
JobID (primary key, or PK; could be the job number)
Customer
etc.

tblQuote
QuoteID (PK)
JobID (related to JobID in tblJob)
other Quote fields as needed

Establish the relationship between tblJob and tblQuote in the Relationships
window. Build a main form based on tblJob, with a subform based on tblQuote.
Set the Link Child and Link Master properties of the subfoirm control to
JobID.

It may seem like semantics, but I doubt Tom would have suggested "to have the
main table relate to the subforms with JobNumber and Option fields". Tables
relate to other tables, so I expect his reference to relationships was about
relating one table to another. The subforms may be based on the related
tables, but we can't see your database, so can only infer how it is
constructed.

Any discussion of this sort needs to start with the table structure, which
depends on the real-world situation behind the database. What is the
database supposed to do?

PHisaw wrote:
Bruce,

Thank you for replying. Per your message,

I'm not sure what this line of code is supposed to do:

Me.JobNumber.DefaultValue = """" & Me.JobNumber.Value & """"


In researching on how to save field info and then repopulate field with
saved info from previous record, this line of code is what I came across, but
obviously it isn't working.
Users have requested the ability to have more than one quote option for the
same job number. Tom's suggestion was to have the main table relate to the
subforms with JobNumber and Option fields - both PK's. Then a button on the
main form that would save the job number from the previous record, insert it
in the new record (new option, same job number) and increase the option by 1
based on last option number.
I have a main quote table, tquotemainform, which supplies frepairquotemain
form. On it are several subforms - labor, parts, and misc parts and all are
related by JobNumber (autonumber and PK) and now by Option (also a PK - I'll
change the name to something other than the reserved word).
John Vinson responded that it may be the jobnumber in the related table. I
asked how I could go about resolving the problem, but received no response.
I just need to know if this is acutally possible as in example below with
both fields being PKs.

JobNumber Option
9549 1
9549 2
9550 1
9551 1
9551 2

Again, thanks for your help.
Pam

I don't know what exactly was in the original string, but I see a few things
in the code you posted.

[quoted text clipped - 56 lines]
Thank in advance,
Pam


--
Message posted via http://www.accessmonster.com