Add a record to a table

J

John

Hello

I need to add a record to a table from a data entry form that has no control source. Is this possible, if so how

I thought I could use the DoCmd.OpenTable method, and then add to the recordset of the open table, but I cant seem to figure out how to reference the recordset of the open table

Thank you
John
 
P

PC Datasheet

John,

I take it that "data entry form that has no control source" you mean no record
source. Your question does not make sense. Why would you have a data entry form
that doesn't have a record source. Any data you enter on the form goes no where.

Why not bind your form to the table where you want to enter the data then any
data you enter will automatically get saved to the table.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


John said:
Hello,

I need to add a record to a table from a data entry form that has no control
source. Is this possible, if so how?
I thought I could use the DoCmd.OpenTable method, and then add to the
recordset of the open table, but I cant seem to figure out how to reference the
recordset of the open table?
 
J

John

Thanks, I realize that I could add a recordsource to the form and then the record would be added automatically. However, one the fields is of memo datatype, to allow for more than 255 characters. I have had on-going problems with record corruption becuase of the way memo fields lock records. So I was trying to create a form that the user can type the input and click an add button, once the add button was clicked, then I would open a recordset, add the input to a new record and update the recordset. I have since found the answer I was looking for, by using the CurrentDB.OpenRecordset method, I am able to accomplish this task. Now the 100 million dollar question is weather or not this will actually help relieve the record corruption. Thank you.
 
C

Cheryl Fischer

John,

Take a look at Access MVP Tony Toews' web pages devoted to MDB corruption.

http://www.granite.ab.ca/access/corruption/causes.htm

--

Cheryl Fischer, MVP Microsoft Access



John said:
Thanks, I realize that I could add a recordsource to the form and then the
record would be added automatically. However, one the fields is of memo
datatype, to allow for more than 255 characters. I have had on-going
problems with record corruption becuase of the way memo fields lock records.
So I was trying to create a form that the user can type the input and click
an add button, once the add button was clicked, then I would open a
recordset, add the input to a new record and update the recordset. I have
since found the answer I was looking for, by using the
CurrentDB.OpenRecordset method, I am able to accomplish this task. Now the
100 million dollar question is weather or not this will actually help
relieve the record corruption. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top