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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update / Insert Problem with datagrid

Status
Not open for further replies.

bigmelon

MIS
Sep 25, 2003
114
US
I have a datagrid for pharmacy charges. If the patient already has charges, then their record exists in the table so i pull it from there. However, if it doesn't exist, i populate a datagrid with all the charges listed and the units column empty so the user can go down and put in the applicable charges. When I try to hit OK for a new patient, I get an error saying the update affected zero records, the reason being it should be an insert not an update since no record exists for them. How do i force it to insert the records even though the description field was already there so it automatically thinks update??

Does that make any sense?

Any suggestions would be greatly appreciated, i have been struggling with it all morning.

Thanks,
Jeremy
 
Melon,
Sounds like an interesting on there buddy. I'm sure i could help you somewhat but i'm confused as hell with what your doing. You lost me with the description field being already there, I'm not quiet sure how you can have a description for a records but nothing else is there. I understand that your trying to do an update on any records in your grid already there and. and if they don't have any records you are adding new charges.

Sincerely,
Fritts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top