T
Tamara
Hi
This is a question about some VBA code that I was
recommended to add to a form by Kevin in a previous post
(displayed below).
1)
When I add "dim db as database" and "dim qdf1 as
querydef" I get a compile error that database and
querydef are not defined. I thought this may have
something to do with add-ins not being installed but when
I reinstalled access, no add-ins were there to install.
2)
What is the sql string that I have to put here.
sqlStr1 = sqlstring to append conferenceID and
contactID to tableConferenceAttendees
3)
What is me! in the following?
with me!comboboxName
Thanks in advance
Tamara
dim db as database
dim qdf1 as querydef
dim sqlStr1 as string
dim itemSelected as integer
dim conferenceID as Long
.....
set db=currentdb
with me!comboboxName
for itemSelected = 0 to .Listcount-1 'combobox listcount
is 0 based
if(.selected(itemSelected))then
sqlStr1 = sqlstring to append conferenceID and
contactID to tableConferenceAttendees
set qdf1 = db.createquerydef ("",sqlStr1)
qdf1.execute
if(qdf1.recordsAffected=0)then
msgBox "There has been an error, contact the
database administrator for assistance",vbOKOnly
endif
...
end if
next itemSelected
end with
This is a question about some VBA code that I was
recommended to add to a form by Kevin in a previous post
(displayed below).
1)
When I add "dim db as database" and "dim qdf1 as
querydef" I get a compile error that database and
querydef are not defined. I thought this may have
something to do with add-ins not being installed but when
I reinstalled access, no add-ins were there to install.
2)
What is the sql string that I have to put here.
sqlStr1 = sqlstring to append conferenceID and
contactID to tableConferenceAttendees
3)
What is me! in the following?
with me!comboboxName
Thanks in advance
Tamara
dim db as database
dim qdf1 as querydef
dim sqlStr1 as string
dim itemSelected as integer
dim conferenceID as Long
.....
set db=currentdb
with me!comboboxName
for itemSelected = 0 to .Listcount-1 'combobox listcount
is 0 based
if(.selected(itemSelected))then
sqlStr1 = sqlstring to append conferenceID and
contactID to tableConferenceAttendees
set qdf1 = db.createquerydef ("",sqlStr1)
qdf1.execute
if(qdf1.recordsAffected=0)then
msgBox "There has been an error, contact the
database administrator for assistance",vbOKOnly
endif
...
end if
next itemSelected
end with