Very basic question about displaying forms (1 Viewer)

sja13

Professional Idiot
Local time
Today, 12:07
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?...
 

Orthodox Dave

Home Developer
Local time
Today, 12:07
Joined
Apr 13, 2017
Messages
218
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.)
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 07:07
Joined
Oct 17, 2012
Messages
3,276
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.
 

isladogs

MVP / VIP
Local time
Today, 12:07
Joined
Jan 14, 2017
Messages
18,216
Maybe this is also basic but what's a 'test harness'?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:07
Joined
Feb 28, 2001
Messages
27,172
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.
 

sja13

Professional Idiot
Local time
Today, 12:07
Joined
May 3, 2017
Messages
63
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!
 

sja13

Professional Idiot
Local time
Today, 12:07
Joined
May 3, 2017
Messages
63
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!
 

Orthodox Dave

Home Developer
Local time
Today, 12:07
Joined
Apr 13, 2017
Messages
218
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!
 

isladogs

MVP / VIP
Local time
Today, 12:07
Joined
Jan 14, 2017
Messages
18,216
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
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:07
Joined
Aug 30, 2003
Messages
36,125
Post 7 was moderated, now approved. Posting to trigger email notifications.
 

Tieval

Still Clueless
Local time
Today, 12:07
Joined
Jun 26, 2015
Messages
475
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

Top Bottom