copying some data from one subform to anther

S

Simon

I know what i am doing is bad practice as its duplicating data but
there is a reason why i am duplicating it, but its hard to expain

I have a form with two datasheet subforms
There will be data in the top subformform (frmManufactureParts) and i
want to copy it to the botton subfform (frmManufacturePartsUsed)


I want a o click button the the form to do the copy


i currently have the following code


frmManufacturePartsUsed.Form!ProductCode =
frmManufactureParts.Form!IDNumber
frmManufacturePartsUsed.Form!Quantity =
frmManufactureParts.Form!Quantity


This coe only copys the bottom line of data from the datasheet.


Is there a way to make it copy all the data


Thanks
 
J

Jeff Boyce

Simon

If you know it is a bad practice, why not ask "is there a way to accomplish
what I need?", rather than asking "how do I do something wrong?"

Since I don't know what it is that you need to accomplish, I can only guess
that you want to "mark" a part as "used" (based on what info you provided).
If this is an accurate guess, there are much easier ways to do this that
what you've asked for help doing.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Simon

I will try and explain what i want to do.
I am building a datbase for manufactuing hot tubs


i have the following tables
tblHotTubs Containers - HotTubID, and ProductName and price
tblProducts Contains the products need to build tub - ProductID,
Product name, Price
tblParts Contains all the parts for each hot tubs -
HotTubID , ProductID, Quantity
tblManufacture Contins the date it was made and HotTubID -
ManufactuerID, Date, HotTubID
tblPartsUsed Contain all the parts used in builidn hot tub -
ManufactureID, ProductID, Quantity, Serials Number


I have a have a form (frmManufactuerTub) where i have a autonumber for
maufactuer ID, i also have a datasheet subform frmPArtsUsed)

what i would like to do is on the main form when i select the hot tub
code what is made it puts all the parts for that hot tub which are
found in tblParts into the subform frmPArtsUsed (tblPArtsUsed)

then once all the intem are in the suform i can add the serial number
of any of the products and can all increase and decreas the products
uses if the hot tub needs to be speceted up or down.


Hope this is clean, if you need any other info just ask, i am just so
struck on how to go about this


Regrads

Simon
 
J

Jeff Boyce

Simon

See comments in-line below...

Simon said:
I will try and explain what i want to do.
I am building a datbase for manufactuing hot tubs


i have the following tables
tblHotTubs Containers - HotTubID, and ProductName and price
tblProducts Contains the products need to build tub - ProductID,
Product name, Price
tblParts Contains all the parts for each hot tubs -
HotTubID , ProductID, Quantity

So tblParts are the actual parts used in building an actual tub? Or is this
all POSSIBLE parts? I assume tblParts has a primary key of PartsID, not
HotTubID (otherwise, you'd only be able to have one part per tub).
tblManufacture Contins the date it was made and HotTubID -
ManufactuerID, Date, HotTubID

Don't use a field called "Date". This is a reserved word in Access and will
only confuse both Access and you. Why isn't the DateOfManufacture stored in
the tblHotTub? (first table listed above)
tblPartsUsed Contain all the parts used in builidn hot tub -
ManufactureID, ProductID, Quantity, Serials Number

How are tblParts and tblPartsUsed different? By the way, if you have a
quantity greater than 1, which part's serial number will you record?
I have a have a form (frmManufactuerTub) where i have a autonumber for
maufactuer ID, i also have a datasheet subform frmPArtsUsed)

what i would like to do is on the main form when i select the hot tub
code what is made it puts all the parts for that hot tub which are
found in tblParts into the subform frmPArtsUsed (tblPArtsUsed)

then once all the intem are in the suform i can add the serial number
of any of the products and can all increase and decreas the products
uses if the hot tub needs to be speceted up or down.

Does this mean that a hot tub normally is comprised of, for example, parts
1, 3, 5, so you want to see parts 1, 3, and 5 show up ... but you can then
add/remove parts and change quantities and ...?

Here's another approach that might work...

If you've ever used one of the Access New Query wizards, you've seen the use
of paired listboxes. That is, the list on the left shows what is available,
while the listbox on the right is for what is selected. I can imagine
setting up a form so that you could pick a hot tub model from a combo box
and get all of that model's parts showing in the left-hand listbox, then
select parts to be included in the exact hot tub you are building (to show
in the right-hand listbox).

Does that sound like what you are trying to accomplish?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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