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

AddNew Method.....Problem

Status
Not open for further replies.

monrosal

Programmer
Aug 22, 2000
42
US
Does anybody know how to add a value from a text box within an AddNew Method.

My code looks like this:
With component_dev
.AddNew
!Information = Me![textBoxValue]
.Update
End With
It doesn't seem to work though. Anybody got some suggestions. thanks
 
Good morning! Sorry, but I need a bit more information. Is component_dev a recordset? If so, does it have a field called Information? What error are you getting? Have you tried setting a breakpoint and stepping through the code to find out where the error is occuring?

Sorry to pound you with questions, but with the answers we should be able to get this to work.
 
Hi Kathryn,

Thanks for your help. Yes - component_dev is the recordset and Information is a field in the recordset. The problem is I'm not even sure what I want the code to do is possible. Let me explain. Do you know how when you create a new record in a table with the programmed "Add New Record" button in access, the new row has been created and as you type in the textboxes the fields in the recordset are populated. Well what I want to do is add rows to two tables at the same time, so that is why I have added this code with the "New Record" button. What I think is happening to the code is a new row is created in my second table but when it is looking at the value of the textbox it sees there is nothing in there, so it gives me a null value error message. Sorry if I confused you right now, but I was thinking about the problem yesterday. If you have any input though, I'd really appreciate it.

Ramon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top