Connect to sub-form without Parent/Child link

D

Dennis

Hi,

I’m running Access via Office XP Pro on Windows 7.

General Question (specific question is at end of discussion):
I have a form with two sub-forms on it. Each sub-form is in a tab control.
There is no direct Parent / Child link to the second sub-form. How do I do
this?

Goal:
To create a screen that allows me to enter my parts orders by vendor
receipt.

Background:
I have a repair shop where most of the parts are ordered as we need them.
The repairs are so varied; it is hard to maintain an inventory of parts
because they are so specialized. We have a few parts that we keep in stock,
but most parts are ordered as needed. Also, each time we order a part, we
might get it from a different vendor and possibly a different manufacturer.

When I order my parts from a vendor, I enter the parts through a part
screen, but then I have to reconcile to the order receipt. What I want to do
is create a “Receive Order†form that is organized from the vendor receipt
point of view. That is, I will use the vendor’s receipt as my input document.

To do this I have a form that is comprised of three parts. The first part
is the vendor’s invoice information and is the main form.

The second part is a sub-form that resides in a tab control on the main
form. The second part is a continuous form that simply lists all of the
parts (that have been entered) for this receipt. This sub-form is a running
receipt and is updated as I add enter new parts. This running receipt allows
me to compare my data entry to the printed receipt and quickly find data
entry errors.

The third part is a “single entry†(as opposed to continuous) sub-form that
resides in a second tab control. This sub-form will enable me to enter the
detailed information associated with this part. This is where I am having an
issue. Since the key to the parts is an Access AutoNumber generated field,
there is nothing to link the Parent and Child forms (other than Vendor and
ReceiptNo and this will bring multiple entries).

My initial idea was to have the order’s individual parts listed on the first
sub-form. I would put an invisible command button over the entire line so
that if a user clicked anywhere on a record’s line on the continuous form,
they would be clicking on the command button. The comment button would take
the Item Number (which is displayed on the first-subform and is the key to
the individual part) and pass it to the second sub-form (which is the parts
form). The second sub-form would then read in the appropriate parts record.

Alternate Approach:
I’ve also thought about creating two forms. The first form would consist of
the Vendor Invoice record and the Parts record. The second form would be a
running receipt. Each time I updated a record in the Parts, I would have the
second form requery itself.

However, this approach still has the same issue in how do I link the Vendor
Receipt and Parts detail forms. Since each form has a different record
source, I figured I needed a form (for vendor invoice) and sub-form (for
parts). It seems like I would have to have a main form for the vendor
invoice and then a combo box where I could select a part, and then jump into
the parts form and somehow send the ItemNo (key to part screen) to the Parts
sub-form.



Database structure:
tblVenInvoice - one record per Vendor’s Invoice.
Key ----------------
VendorID - Foreign key to tblVendor table.
InvoiceNo - From invoice number of invoice paper.

Data ----------------------
Purchase / Invoice Date
Paid By
Paid Date
CheckNo


tblParts
key – ItemNo - Access Autonumber field

Data --------------------
VendorID
InvoiceNo
Part Description
ManufacturerID
Price
Tax
Shipping
WarrantyPeriod
WorkOrder


Question:
1. Does this approach make sense or is there a better approach?
2. If this is an appropriate approach, what is the best way to “send†or
“link†my ItemNo from my first sub-form to the second sub-form?

Thanks,

Dennis
 
S

Stefan Hoffmann

hi Dennis,

General Question (specific question is at end of discussion):
I have a form with two sub-forms on it. Each sub-form is in a tab control.
There is no direct Parent / Child link to the second sub-form. How do I do
this?
Either you have such a relation or you haven't. You have take into
account, that in most cases you can create a query for your sub form in
a way that you can always create such a link.

In some cases there is only on problem: you may need to apply an
additional filter on the sub forms.

This is normally done in the main form's On Current event. If you don't
want the users to remove this filter under all circumstances then you
need to reassign the record source of these sub forms including the
filter condition in an appropriate WHERE clause. Which I prefer in most
cases.

This technique could also be used in the case where you cannot build
such a base query, e.g. because it would query to much data, thus
unnecessary slowing down your application.
Question:
1. Does this approach make sense or is there a better approach?
Too much text ;) I sounds okay, but I'm not your user...
2. If this is an appropriate approach, what is the best way to “send†or
“link†my ItemNo from my first sub-form to the second sub-form?
See above.



mfG
--> stefan <--
 
D

Dennis

Stephan,

In short, I am trying to create an invoice data entry form. When I receive
my parts from the vendor, I also receive an invoice. I'm want to use that
invoice as my data entry documents.

As such, there is the vendor's invoice information and the parts. The
relationship between the parts and the invoice are the vendor number and the
invoice number. However, on the parts sub-file there is also the part number
or line number on the invoice.

Just for the sake of discussion, let's say I used the line number on the
invoice for my part number. The question is, how do I setup my sub-form for
entering the parts?

I guess I'm having a problem "visioning" how to navigate from the Vendor
Invoice form to the Parts sub-form.

Dennis
 
S

Stefan Hoffmann

hi Dennis,

In short, I am trying to create an invoice data entry form. When I receive
my parts from the vendor, I also receive an invoice. I'm want to use that
invoice as my data entry documents.

As such, there is the vendor's invoice information and the parts. The
relationship between the parts and the invoice are the vendor number and the
invoice number. However, on the parts sub-file there is also the part number
or line number on the invoice.

Just for the sake of discussion, let's say I used the line number on the
invoice for my part number. The question is, how do I setup my sub-form for
entering the parts?

I guess I'm having a problem "visioning" how to navigate from the Vendor
Invoice form to the Parts sub-form.
This sounds like a simple master-detail scenario, if don't misunderstand
you.

Your master (main form or parent) form is the invoice head. The detail
(sub form or child) contains only the parts listing.

http://office.microsoft.com/en-us/access/HA100986741033.aspx



mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top