Really Struggling with copying!!!

DeanRowe

Registered User.
Local time
Today, 09:35
Joined
Jan 26, 2007
Messages
142
Hi,

Would anyone please be able to help me? I've been really really struggling with this problem!

I have two forms - the first is my "OrdersForm" where I process my sales information, such as the products being sold on each order and their prices. I have ten sets of fields to allow ten different products to be sold at once.

I have a second form which pops up over the order form and stays in place while I am typing on the "OrdersForm", This has a combo box bound to my products table so i can search through my products and bring up each ones information such as its description, weight, and price.

Its quite handy as it means I can find the product and its information, and when I click onto my order form it stays up and I can still see the info while I'm entering the details.

However there are quite a few different fields to type, and if the customer orders many products it takes quite a long time to enter all the details in, and occassionally some of my staff type the wrong amounts in!!!

I considered incorporating the popup form into the orders form, so I wouldnt need to copy the information as it would already be there. But I need the popup form so i can view the product information - there wouldnt be enoguh room on the order form for all this. Plus when I did try this I couldnt get it to work, as I had great trouble linking each combo box to each set of fields - If i changed the combo value in one, it would change the fields for all the items. So because of these two reasons I need to do the following...

I would like to place a command button under each set of fields, so when I have the correct product selected in my popup form, it can copy the fields into my "OrdersForm". For example:

I bring up the details for a "Stihl MS180 15" Chainsaw" in my popup form, then I click the command button "Import Details" under the set of fields for Sale item One - and it copies the pricing fields from the popup form into my order form.
I then bring up my next product on the popup form, a "Stihl Chainsaw Carry Case" and click the "Import Details" button under the set of fields for Sale Item Two etc.

Would a Macro be the best way to achieve this? Or could this be managed in VB script? And which commands should I be using?

I'm not very good at working out the codes for things - I normally use wizards to perform most tasks for me. So I am really struggling now I've got to this stage. Any help would be greatfully received. Would the code be something like this:

Private Sub ImportDetailsbutton1_Click()

[Focus on] [CurrentRecord] Popupform
Me.[OrdersForm].[FieldOne].Value = [Popupform].[FieldOne]
Me.[OrdersForm].[FieldTwo].Value = [Popupform].[FieldTwo]
Me.[OrdersForm].[FieldThree].Value = [Popupform].[FieldThree]
Me.[OrdersForm].[FieldFour].Value = [Popupform].[FieldFour]
Me.[OrdersForm].[FieldFive].Value = [Popupform].[FieldFive]

End Sub

and then repeat this code for each button under each set of fields, ie ImportDetailsbutton2 etc.

I know this code is wrong but is the idea correct? If anyone could help I would be very thankful.

Thanks for taking the time to read this.
 
I would think you would have the customer information on a MainForm that has a SubForm with all of the items ordered. You would then not be limited to ten items per order.
 
Because of the market I'm in - Outdoor/Garden machinery - my customers don't place regular orders, maybe only once or twice a year, so I have kept the Customers name, address and contact information in the "Orders" table - along with the details of the sale. Although there are ten fields, they have never all been used.

I know this isn't ideal or how it should be, I know I should have a seperate "Customers" table - however as a complete novice when I first made the database I decided to keep the customer's details and their order all together. Nice and simple. For now it's working and I'll be keeping it like this for now, but when I get the time in the future, and bigger customer contracts I will implement this.

The system is working well, except for the problem of copying the Product information from the popup form into the Orders Form, any ideas on how to do this?
 
I'll give it some thought but I hope you realize that the structure of your tables and forms complicates the solution. Some guru will drop by with an absolutely perfect solutions for you.
 

Users who are viewing this thread

Back
Top Bottom