Need Advice Please

T

Tom

I realize that this is the queres group, and not the macro group, but
please bear with me a moment. I have already tried the macro route,
and am having a problem. Perhaps a macro is not the best solution...

I have a job that involves a series of queries. There are 33 to be
exact. They delete the records in the table, create new records, then
poplulate the new records with the appropriate data. These work when
run individually, and when run set up in my macro. But...

They take a fair amount of time, and I'd like to display a progress
bar to show that Access is in fact still working. Since I've just
finished playing wth a progress bar elsewhere in my db, I believe I'm
okay with this part.

My question involves trying to put them both together. I've created a
new module with several functions. They are, "open" the progress bar,
"update" the progress bar, and "close", "reset" the Max task value,
etc.

I've modified my macro, adding "RunCode" at the beginning to run my
"open" the form code. After several queries I reset the task PB Max
value and update the PB again. (I have two PBs, one for the 'overall'
process and one for 'this task'. I will reset the 'this task' PB Max
value several times.)

Well, right off the bat it doesn't work. I mean, right in the
beginning, when my macro goes to run the code goes to open the form,
VB displays an error msg stating that it cannot find the form. I
don't understand why, as I'm using the same code as my "other" PB
work, and IT works just fine. I've tried:

DoCmd.OpenForm "frmProgressBar".

VB doesn't like it. I've also tried:

DoCmd.OpenForm acForm, Forms!frmProgressBar.Name

VB doesn't like this either.

Here's an idea I just thought of as I was composing this message:

Can I, should I, put everything in a module? I mean, use the "DoCmd"
to not only open the form, but also to run my queries? Then there
wouldn't be any "switching" back and forth, right?

Am I even CLOSE? Or am I way off base? I'd appreciate hearing from
others that can help me fix this and/or recommend a better/best way to
accomplish what I'd like to do. (Assuming it's even possible.)

Thanks in advance,

Tom
 
C

Chris2

Tom said:
I realize that this is the queres group, and not the macro group, but
please bear with me a moment. I have already tried the macro route,
and am having a problem. Perhaps a macro is not the best solution...

I have a job that involves a series of queries. There are 33 to be
exact. They delete the records in the table, create new records, then
poplulate the new records with the appropriate data. These work when
run individually, and when run set up in my macro. But...

They take a fair amount of time, and I'd like to display a progress
bar to show that Access is in fact still working. Since I've just
finished playing wth a progress bar elsewhere in my db, I believe I'm
okay with this part.

My question involves trying to put them both together. I've created a
new module with several functions. They are, "open" the progress bar,
"update" the progress bar, and "close", "reset" the Max task value,
etc.

I've modified my macro, adding "RunCode" at the beginning to run my
"open" the form code. After several queries I reset the task PB Max
value and update the PB again. (I have two PBs, one for the 'overall'
process and one for 'this task'. I will reset the 'this task' PB Max
value several times.)

Well, right off the bat it doesn't work. I mean, right in the
beginning, when my macro goes to run the code goes to open the form,
VB displays an error msg stating that it cannot find the form. I
don't understand why, as I'm using the same code as my "other" PB
work, and IT works just fine. I've tried:

DoCmd.OpenForm "frmProgressBar".

VB doesn't like it. I've also tried:

What error message is issued?
DoCmd.OpenForm acForm, Forms!frmProgressBar.Name

VB doesn't like this either.

What error message is issued?
 
T

Tom

What error message is issued?

Error # 2450 was generated by MSAccess
Microsoft Access can't find the form 'frmProgressBar' referred to in a
macro expression or Visual Basic code.
What error message is issued?

Error # 2450 was generated by MSAccess
Microsoft Access can't find the form 'frmProgressBar' referred to in a
macro expression or Visual Basic code.
 
C

Chris2

Tom said:
Error # 2450 was generated by MSAccess
Microsoft Access can't find the form 'frmProgressBar' referred to in a
macro expression or Visual Basic code.

Rooting around the internet reveals this doesn't seem to be too common an
error.
What I've discovered leads me to believe it *might* be one of the
following.
Either the form isn't open, or doesn't exist (or is misspelled and
therefore appears to not exist).
Some piece of code on the form may have experienced a compile error.

I searched around the knowledge base, and microsoft.com, but to no avail.
 
T

Tom

Thanks.

I THINK I know. I haven't gone back to play with it since (no time).
I think it wasn't open. And...obviously...I didn't know any better.

Appreciate the help.

Tom
 

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