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.
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.