PDA

View Full Version : Excel VBA Shopping Cart



Rpsnike9
11-26-2011, 08:58 PM
Hello,

I am working on a project that is quite extensive and to be honest I am Relatively new to vba, as well as to the forum. I am trying to make a shopping cart that works as follows; I have a spreadsheet called ShoppingCart and it contains a listbox (ProductList) that displays 9 products. I want to make a single click procedure that pops open a User Form (FrmShirts) when a specific product is clicked. This form needs to be specific to the product clicked. For instance, the User form must contain an image of the specific shirt clicked. While also displaying a specific price for that Item, a title of the product (The product name; which is displayed in the ProductList), and a discription of the product (i.e "This Shirt is printed on a 100% Cotton American Apparrel Shirt....").

Currently all I have completed is the PropertiesList ListBox, which contains the 9 products. Currently I have the reference for the listbox in the same worksheet, in coloumn J (columun I contains product #'s, and column K contains Product $'s) The List Box's Single click procedure brings up FrmShirts, which contains the layout of the User Form (i.e 2 Buttons (Close and Add to Cart), and an empty image box for the undeclared image, text boxes for the decription and price, and option buttons (S,M,L,XL). But I am stumped on how exactly to set the variables for all the changing properties in the user form

Private Sub ProductsList_Click()

FrmShirt.Load
With FrmShirt
ShirtImage =
ShirtLabel =
DescriptionBOX =
PriceBox =

End Sub

I am not sure if I even have the right syntax. I assume I have to set variables to all the FrmShirt properties. But how do I go about that? How specifically do you load pictures to that ShirtImage Image box as a variable and where should I keep the information for the properties.

(After I want the Add to Cart Button to Put the selected shirt and its approriate properties into a virtual shopping cart (i.e. in a different Spreasheet)

Thanks, Ryan

GTO
11-27-2011, 02:57 PM
Greetings Ryan and welcome to vbaexpress :-)

I would suggest zipping several small jpg's and the workbook (in .xls format), and attaching the zip.

Mark

Rpsnike9
11-30-2011, 02:00 AM
Hey,

Sorry for the delayed response Mark I was finishing up another project but here is that zip. I am in desperate need of some help on this one. I have also attached a general scope of the problem in a word document.

Thanks for any and all help

Ryan