Re: Assigning Variable from Combo Box

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Dirk,
Thanks for your reply.
I understand that I need to add code to get the new typed in info to
be stored to the 7 different tables, but first, I want to assign a variable
from all of my 21 combo boxes entries. Then, at the end, have one button
that will open the corresponding tables and add the new data.
I believe "Limit To List" data needs to be set to "No", so I'm going
that
route for now, at least until I find out that the variables are not being
assigned properly. For now it appears to be working.
Once again, thanks for your assistance.


Dirk Goldgar wrote:
Okay, I'm kind of a newbee to Access. I'll try to explain what I've
done thus far and
[quoted text clipped - 19 lines]
"The text you entered isn't an item in the list."
So, I'm missing something(s) somewhere. Any suggestion?

It's not enough just to tell Access that the data has been added to the
table ("Response = acDataErrAdded"); you have to actually add the new
artist to the table yourself. Something like this:

'----- start of example code -----
Private Sub Artist1_NotInList(NewData As String, Response As Integer)

CurrentDb.Execute _
"INSERT INTO ArtistBand(ArtistBand) " & _
"VALUES(" & Chr(34) & NewData & Chr(34) & ")", _
dbFailOnError

Response = acDataErrAdded

End Sub
'----- end of example code -----


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200703/1

.


Quantcast