Discussion Locked

VB6, Access97

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a database of parts and one of the fields is Status.

How would I go about displaying that list on one form with a combo box to change the status(eg from 'In Stock' to 'Sold').

I want the combo box to be populated from another table.

So it's basically a two column table with the second column's cells being combo boxes.

Or is it only possible to have a transport control on the bottom and only have one part displayed at a time?

Any idea's would be appreciated, Thanks

Craig

11 replies

by seagull data services

You should be able to calculate whether your parts are in stock or not by subtracting the number sold from the total taken into stock. Create a query to calculate this and you can display how many are in stock. If you want to just show if there are any in stock then you could either use a checkbox or a label and set the caption using the formula
iif([InStock]>[Sold], "In Stock", "Sold") where InStock and Sold are the totals of no in stock and no sold.

by donq

Your question is lacking a little "normal" inventory information. (i.e., "units" {or how many in a box, how long is the board, etc.} and "quantity" {i.e., how mahy units are on hand?}

Your question as worded could simply be accomplished with a simple (Yes/No Logical) "Check box" where checked = in-stock and unchecked = sold (or visa-versa as you choose)?

I use 1 Table named "Inventory" or "Supplies" or "Parts" (whatever) and place a single Numeric "Qty" Field in each record along with a Foreign Key to a seperate "Units" Table where I define Pounds or Gallons, or Feet, Or Box of 12 - Bag of 100 (whatever comes when you buy 1 unit?).

Then I just adjust "Qty" based on "each".

by craig shepherd

There is probably a better way to do this but at the moment I'm using this table to record the serial numbers of the parts.
I have their supplier and who they're sold to.
It's the sold to box that I want to be able to change. The drop down box will have all the clients in there as well as an In Stock option.

Sorry, I should have put this in before.

by craig shepherd

Here's what I want to happen.
Parts come in -> Their serial numbers get put in my database and they are 'In Stock'

I build a computer -> I change each parts 'In Stock' status to the name of who the computer is going to

I just want to know if I can have all the parts listed in a table with a combo box for the status.

by mohammad_m_saggaf

From what I understood -if it is correct- it is possible to do it using VB6.
you have to build a form that have a label for every field you don't have to edit, Textbox for every field you have to edit, and combobox for status field.
you open the database using the ADO CONNECTION object. And query all the fields you need in one SQL statment using the RECORDSET object of the ADO.
you can use the data properties of Label, Textbox, and Combobox controls - which are DataField, DataFormat, DataMember, and DataSource - to link the data in the Recordset with them.
The status will appeare in the comboBox.
Also you can use the recoredset methods - AddNew, Delet, and Update - to deal with the data.

I hope I helped.

Note: If you need a sample you can send me the database structure and the fields that you want them in the form and i'll make a simple form for you.

by craig shepherd

I've already got all that happening on one of the forms.

I want this one to display all the records in a tabular format, which I can do.

But can I make the Status cells an editable combo box?

This discussion is closed to new replies.