Need Advice Please

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I'm posting this question here, as 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.

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.

Thanks in advance,

Tom
 
Tom,

Hopefully this will be relevant to the cause of your problem... The
RunCode macro *must* refer to the name of a Function. You will need to
set up your progress bar code within a module, and define it as a
function, and then it has to be entered in the macro argument with this
syntax...
YourFunctionName()
i.e. it has to have the ()s
 
Back
Top