Button driving me crazy!! (1 Viewer)

Benny Wong

Registered User.
Local time
Today, 09:25
Joined
Jun 19, 2002
Messages
65
Hello All,
I am using Access 2000. I currently have a form that has three buttons. The three buttons are:
cmdClickme = TransferSpreadSheet
cmdstep1exit = Quit Application
cmdReturnToMainMenu = Return to Main Menu

The purpose of the form is to allow the user either click the cmdClickme button to transferspreadsheet to C:\tblclientblank.xls or click cmdReturnToMainMenu to return to Main Menu.When the process is done another button shows up which allows the user to exit the application. The last button allows the user to return to main menu if the button cmdClickme is not depressed.

My problem is when the cmdClickme is depressed the TransferSpreadSheet works and the cmdstep1exit does show up but the cmdclickme with the cmdstep1exit. I would like the cmdclickme to be invisible however VBA says the cmdclickme has the focus. How can I correct this problem? Thanks in advance for your assistance or advice.
 

mark curtis

Registered User.
Local time
Today, 17:25
Joined
Oct 9, 2000
Messages
457
looks like cmdClickme is putting the focus on cmdclickme therefore remove the .SetFocus line from the code

If that don't work post the code behind cmdClickme
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:25
Joined
Feb 19, 2002
Messages
43,257
You cannot hide a control that has the focus. In the TblCwLoadscalesPc43 Click event, after the TransferSpreadsheet, you need to set focus to another control and then you can hide the TblCwLoadscalesPc43 button.

Me.cmdReturnToMainMenu.SetFocus = True
Me.cmdClickme.Visible = False
 

Users who are viewing this thread

Top Bottom