K
Kr4g3n
Guest
Hi, not sure what I'm doing wrong here, I am trying to create an add stock form to my table, this table will reference the items table to pick the stock that I am updating.
there are two tables
Code:
CREATE TABLE [dbo].[TblItems] (
[ItemID] INT IDENTITY (1, 1) NOT NULL,
[ItemCat] VARCHAR (15) NOT NULL,
[ItemName] VARCHAR (30) NOT NULL,
[ItemUnit] VARCHAR (5) NOT NULL,
PRIMARY KEY CLUSTERED ([ItemID] ASC)
and
Code:
CREATE TABLE [dbo].[TblStock] (
[StockID] INT NOT NULL,
[ItemID] INT NOT NULL,
[ItemQTY] FLOAT (53) NOT NULL,
[ItemCost] MONEY NOT NULL,
[UnitCost] MONEY NOT NULL,
PRIMARY KEY CLUSTERED ([StockID] ASC),
CONSTRAINT [FK_TblStock_TblItems] FOREIGN KEY ([ItemID]) REFERENCES [dbo].[TblItems] ([ItemID])
);
On the form itself, I have the datagrid and details components for TblStock.
For the [ItemID] field I have a combobox [ItemIDComboBox]
Using the designer I checked the box to "Use Data Bound Items"
And set the following values...
Datasource = TblItemsBindingSource
DisplayMember = ItemName
ValueMember = ItemID
The combobox itself works and populates the dropdownlist with items from TblItems
BUT
when I select an item from the list, the rest of the form is disabled, I cannot click into or type into any other fields and Save seems to be disabled.
Continue reading...
there are two tables
Code:
CREATE TABLE [dbo].[TblItems] (
[ItemID] INT IDENTITY (1, 1) NOT NULL,
[ItemCat] VARCHAR (15) NOT NULL,
[ItemName] VARCHAR (30) NOT NULL,
[ItemUnit] VARCHAR (5) NOT NULL,
PRIMARY KEY CLUSTERED ([ItemID] ASC)
and
Code:
CREATE TABLE [dbo].[TblStock] (
[StockID] INT NOT NULL,
[ItemID] INT NOT NULL,
[ItemQTY] FLOAT (53) NOT NULL,
[ItemCost] MONEY NOT NULL,
[UnitCost] MONEY NOT NULL,
PRIMARY KEY CLUSTERED ([StockID] ASC),
CONSTRAINT [FK_TblStock_TblItems] FOREIGN KEY ([ItemID]) REFERENCES [dbo].[TblItems] ([ItemID])
);
On the form itself, I have the datagrid and details components for TblStock.
For the [ItemID] field I have a combobox [ItemIDComboBox]
Using the designer I checked the box to "Use Data Bound Items"
And set the following values...
Datasource = TblItemsBindingSource
DisplayMember = ItemName
ValueMember = ItemID
The combobox itself works and populates the dropdownlist with items from TblItems
BUT
when I select an item from the list, the rest of the form is disabled, I cannot click into or type into any other fields and Save seems to be disabled.
Continue reading...