dao and ado

T

thersitz

Access 2002, xp

Is it ok to set references to both ado and dao libraries?

after using this code

Dim thisDB As DAO.Database
Dim thisRS As DAO.Recordset

I am getting this error:

compile type:
user-defined type not defined

and then when I go into debug mode this code is highlighted:

Private Sub cboBCity_NotInList(NewData As String, Response As
Integer)


thanks
 
R

ruralguy via AccessMonster.com

YES! You simply need to specify the library every time you dimension a
variable for either ADO or DAO.

I doubt there is anything wrong with the line you say is highlighted by the
debugger since it is the first line of the NotInList event for that ComboBox
that looks like it was created by Access. I would look elsewhere for the
problem.
 
T

thersitz

thanks ruralDude.

I added the DAO 3.6 library to my app. But now I am getting a new error.

runtime 438
object does not support this property ot method

After I type in a new city in the combo box, I want to write the new city to
the tblCities, but I also want to add the stateID to tblCities for that new
city. So I dimmed a variable and called it

strNewState

and then I tried to get my procedure to grab the stateID of the current
record -- which I just added and isn't saved yet -- because I haven't moved
to the next record.

so I set my variable as such:

strNewState = Screen!ActiveForm!cboBState.Column(0)

and then i get the error.

would this work:

strNewState = Screen!ActiveForm!cboBState.Column(0).text

i guess I will try. But is there a better way to grab that stateID?

thanks
 

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