Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form "Refreshment"

Status
Not open for further replies.

MilinPCH

Technical User
Jul 27, 2000
37
0
0
US
As mentioned briefly in a previous post, I have a macro button that executes an append query and then a delete query to "save" records that have been entered into a form - actually, these saved records are within a subform. My problem is that when the macro executes and does it's job, my subform (which is in datasheet view) has "deleted" written across the lines which were moved. That's ok, as I understand what it's telling me. What I want to show is just the blank next line (get rid of those "deleted" lines) - waiting for the next set of entries. I notice that those lines go away if I close and reopen the form, so I've assumed I have to run some sort of repaint or refresh command, which I've been trying to attach to the end of my list of macro commands, but with no luck. I've tried repainting the main form and the subform (Access tells me I have to open it first, which I think I did) and still no luck.

Any thoughts to lead me towards the path of wisdom?
(Hope all you Seattle folks are ok)

Milin
 
The vba commands you are looking for are

me.refresh
me.requery
me.repaint

I don't use macros, so I don't know how to put them in a macro, but you could just add this to the code that runs on your macro button.
Mike Rohde
rohdem@marshallengines.com
 
Hi
I'm doing basically the same thing you're doing. The way I eliminated the "deleted" lines was to base my form on a query. To keep my query simple I included all fields and made it sort on one column. My macro includes the following:
setwarnings - no
hourglass - yes
openquery - append
openquery - delete
requery - [requeries the underlying table]
runcommand - [a failed attempt to go to the next record]
Hourglass - no
That ends my macro. Now after the deletion I can forward to the next record and the previous/deleted record is gone from the form. However, I want the form to automatically go to the next record without user intervention. I've tried refresh, repaint, goto next. No luck with any of it. Have you by chance mastered it yet?

Later....
O'Neal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top