By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

Help with syntax in module

P: n/a
Access 97
Trying to write code for Sub A() in a module.
Dim AppendData As Object

Set frm = Forms!Members
Set ctl = frm!Names
'ctl is a list box, approx 15 names, only 2 or 3 selected at one time.
For Each varItm In ctl.ItemsSelected

DoCmd.RunMacro (AppendData)
Error message = "Object variable or With block variable not set"
'Appending to a temp table. Run macro by itself works correctly.

Next varItm
Should the macro name (AppendData) be dimensioned as an Object?

Tried lots of set statements for the AppendData macro, none correct.

The macro opens an Append query. SQL statement much too long (>256 characters)
for "DoCmd.RunSQL"

Aug 9 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Thu, 09 Aug 2007 08:00:51 -0400, Chuck <li*****@schoollink.netwrote:

Sorry for the sloppy message.
Should have been signed

Just a wizard pordder
Chuck
--
>Access 97
Trying to write code for Sub A() in a module.
Dim AppendData As Object

Set frm = Forms!Members
Set ctl = frm!Names
'ctl is a list box, approx 15 names, only 2 or 3 selected at one time.
For Each varItm In ctl.ItemsSelected

DoCmd.RunMacro (AppendData)
Error message = "Object variable or With block variable not set"
'Appending to a temp table. Run macro by itself works correctly.

Next varItm
Should the macro name (AppendData) be dimensioned as an Object?

Tried lots of set statements for the AppendData macro, none correct.

The macro opens an Append query. SQL statement much too long (>256 characters)
for "DoCmd.RunSQL"
Aug 9 '07 #2

P: n/a
On Thu, 09 Aug 2007 08:08:33 -0400, Chuck <li*****@schoollink.netwrote:
>On Thu, 09 Aug 2007 08:00:51 -0400, Chuck <li*****@schoollink.netwrote:

Sorry for the sloppy message.
Should have been signed

Just a wizard pordder
Chuck
Thank you Allen Brown for you reply to "Print multiple records from a form into
a report" from Dave.

This is exactly what I need to do.

Chuck
--

Aug 9 '07 #3

P: n/a
On Thu, 09 Aug 2007 09:10:01 -0400, Chuck <li*****@schoollink.netwrote:
>On Thu, 09 Aug 2007 08:08:33 -0400, Chuck <li*****@schoollink.netwrote:
>>On Thu, 09 Aug 2007 08:00:51 -0400, Chuck <li*****@schoollink.netwrote:

Sorry for the sloppy message.
Should have been signed

Just a wizard pordder
Chuck

Thank you Allen Brown for you reply to "Print multiple records from a form into
a report" from Dave.

This is exactly what I need to do.

Chuck
Spoke too quick. Too bad I'm working in Access 97 and your sample database is
in Access 2000.

I'm going to try to work it out from "Search Criteria" html file.

Chuck
--

Aug 9 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.