I am trying to use the sql INSERT INTO statement to add a new record.
This is the SQL statement:
sql = "INSERT INTO tblpatients(bbid, patientname, orderdate, ordertime,
mrnumber, sex, age, drawnby, drawnbytime, doctor, dob, location,
type-r-h, donortype-r-h, componet, antibody, unitnum, expdate, coombs,
crossmatch, rhogam, unitnumber2, expdate2, fetal, commanet) VALUES
('bid', 'ptname', 'orddte', 'ordtime', 'mrnum', 'ptsex', 'ptage',
'drawby', 'drawbytime', 'doc', 'ptdob', 'loc', 'typerh', 'dnrtype',
'compo', 'antibdy', 'unitnumber', 'expdte', 'combs', 'crsmtch', 'rhogm',
'unitnumber2', 'expdte2', 'baby', 'comments')"
I then use the following command to run it.
DoCmd.RunSQL sql
What this is doing is adding a new record to the table and then printing
a report based on the new record.
I am not very good with VBA so this was the best I could come up with.
I get a SQL syntax error when I run it. I tried the way the help in
MS-Access should me but that did not work either.
Ayone have any ideas?
Michael Charney
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!