Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Access: Hide an already open window with VB or Macro


(!)

firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
06-Apr-2007, 10:48 AM #1
Access: Hide an already open window with VB or Macro
I need to hide a window thats already open using some VB or a macro.

Anyone know how?

Thanks
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
06-Apr-2007, 02:23 PM #2
Which type of window?
Is it a Form/Report or an actual Access system window?
firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
06-Apr-2007, 02:42 PM #3
HI OBP i thought it would be you who'd reply.

Yup its just a form in access.
I know how to hide a form from open using a macro but the form needs to be visable at first then hide.

Is there any DoMenuItem VB to do the Window > Hide > [Form Name] ?


Also on a completely different topic do you know how to get access to select a specific item in a list box on a form?

Thanks
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
06-Apr-2007, 02:48 PM #4
firestormer, you can use the direct
FormName.Visible = False
to hide a form, where FormName is the name of your form. It depends on where you are trying to hide it from.
The second question I am not clear on, does the user select an item and you want to know what it is?
Or do you want to run through the List "Source" and match to a value?
__________________
OBP
I do not give up easily
firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
06-Apr-2007, 03:05 PM #5
Great the code works Thanks

Second Question.

The list box is on a form and is set up so that when an item on the list box is selected the form goes to the appropriote record.

The problem is if the user uses the mouse wheel, keyboard ir navigation buttons to change record. When this happens the item selected on the list box remains the same thus possible confusing the user.
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
06-Apr-2007, 03:09 PM #6
This sounds like the List Box is Unbound?
firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
08-Apr-2007, 06:55 AM #7
Sorry for the delay, i didnt get an email that you'd posted.

The list box is unbound.
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
08-Apr-2007, 01:18 PM #8
For the list box to retain a prior selection it has to be "bound" to a Field in the form's underlying table or query, otherwise there is no way for Access to remember what selection you have made.
firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
09-Apr-2007, 10:32 AM #9
If its bound then when an item on the list is selected the record will be altered to that item on the list.

This list is a list of the records in that form. By selecting the record form the list the form goes to that record. BUT when the record in view is changed by other means (keyboard navigation buttons) the list dosnt reflect that move.

I have attatched the relevent sections of the DB.
Attached Files
File Type: zip db1.zip (212.3 KB, 283 views)
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
09-Apr-2007, 11:07 AM #10
Is this what you want it to do?
Attached Files
File Type: zip db1.zip (256.6 KB, 401 views)
firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
10-Apr-2007, 04:51 AM #11
Yeah, what did you do?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
10-Apr-2007, 04:57 AM #12
Added a line of VB code to the On Current event procedure.
firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
10-Apr-2007, 05:04 AM #13
GREAT, thanks.

This project is nearly reaching an end THANK GOD!

if just got to make some final tweaks and thats it.

Thanks for all your help.
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
10-Apr-2007, 05:24 AM #14
firestormer, my pleasure, see you on the next one.
firestormer's Avatar
Computer Specs
Member with 1,254 posts.
THREAD STARTER
 
Join Date: Sep 2005
Location: UK
Experience: Skilled: Know all i know and little else
10-Apr-2007, 06:49 AM #15
Im back (already), I realy ought to buy a book on VB and Access.

Say i have a form (From1) it has fields A and B where A is the primary key.
I have another form (Form2) it has fields B and C where B is the primary key.

I want to create a button in Form1 which when clicked will open Form2 and go to the reocrd where B in Form 2 is the same as the B shown in Form1.

What VB will i need? I figure the VB will need to go in Form1 and this is what i have so far:

Private Sub Command1_Click()
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form2"
DoCmd.Minimize

DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord

After that im stuck
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2