Very basic question about displaying forms

sja13

Professional Idiot
Local time
Today, 20:15
Joined
May 3, 2017
Messages
63
I'm in the Access 2010 VBA editor, developing VBA code (fairly experienced in VBA, but not in Access VBA), and to test my code I'd like to execute a test harness to display a particular form. When I single step the code I can switch windows to see what's happening to the form, but at times I'd like to force the form to be the current visible window. Tried lots of "DoCmd" variants, but haven't found the answer yet. Can anyone point me in the right direction?...
 
There was a post on this website in Jan 2008 labelled:

"Bringing an open Access form in the background to the front"

Google that and it should hopefully answer your question.

(Which particular "God's own country" by the way? I thought they were all God's.)
 
Actually, it says 'County', not 'Country'.

Does the Vatican qualify as a county? :D

If we're going with countries, then you've got all the theocracies and pseudo-theocracies claiming that title: Iran, Vatican City, Afghanistan, Mauritania, Saudi Arabia, Sudan, Yemen, Pakistan, and the exiled government of Tibet.
 
Maybe this is also basic but what's a 'test harness'?
 
If both screens in question are part of Access, you can do a macro that includes a "bring to front" action. If not, you will have to put together some things from user32.dll to let you manipulate non-Access windows, which can be tricky. You can look up the required details online in either case.

Just remember if you have to go to user32.dll, the required window handle on any displayed form is Me.hwnd as a WORD integer, not a LONG.
 
Thanks to all - I'll investigate the links and no doubt find the answers.

Ridders - in my parlance a "test harness" is just some method of causing something to execute to see what happens.
In this case it's some VBA code which won’t be in the final version, but just exists to execute some code I'm developing, where I don't want to go through the full execution from the normal start point; I just want to concentrate on debugging a specific piece of code.

And to all who enquired about God's Own County - of course all Counties are God's Own - it’s just that Yorkshire in England just happens to be preeminent among equals!
 
Ridders - A “test harness” is some code not destined to be in the final version, but which will set up conditions to allow code which IS destined to be in the final version to be tested during development, usually for the purpose of debugging.

To those interested in “God’s Own County”, I agree that all of God’s Counties are of course equal, it’s just that Yorkshire in the U.K. is of course preeminent amongst equals!

Thanks to all responders – I should now have enough clues to negate my clueless state! Ta!
 
I knew it had to be Yorkshire! I lived in Hull in the '70s when it was officially "Humberside" but they always considered themselves Yorkies and I consider myself an honourable one! Yorkies are in a class of their own!
 
Chocolate bars?

I'm from SW England though I also used to live in York which if I remember right was where Yorkie bars came from originally
 
Post 7 was moderated, now approved. Posting to trigger email notifications.
 
It's good to see in our modern politically correct world that the Yorkie bar now weighs 46g instead of the original 70g and they have removed the 'not for girls' sign from the wrapper.
 

Users who are viewing this thread

Back
Top Bottom