Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert not working properly on datagrid

Status
Not open for further replies.

UHNSTrust

Technical User
Dec 2, 2003
262
GB
I have a datagrid which is populated by a dataset. The dataadapter was set up with the wizard and has created the SELECT, INSERT, UPDATE and DELETE commands.

I have ammended the insert command to take a value off the main part of the form. Like so;

Me.OleDbInsertCommand3.CommandText = "INSERT INTO tblWork(ApptID, WorkTypeID, Quantity) VALUES (" & Val(Me.editApptID.Text) & ", ?, ?)"

When I add a record (i.e. workTypeID and quantity) the update command puts the value typed into the workTypeID field into the Quantity field and the value for the quantity is missing.

I have been racking my brains all day and seem to be getting nowhere. The UPDATE, DELETE and SELECT commands works perfectly.

Has anybody any ideas??

Thanks in advance

jonathan

 
Jonathan,

my first question is are you really using question marks in those fields? if so then try setting them to nothing or 0 or ''. Also what type of fields are they.
HTH,
bueller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top