Missing cursor from text field after hiding navigation pane

rivendell_lock

New member
Local time
Today, 08:38
Joined
Feb 27, 2013
Messages
2
Hi there, I am a newbie here but have used this forum in the past to meet my needs..until now :D I have a strange thing that is going on and thanks in advance to those willing to offer input.


I am working on a scanner DB using Access. In the DB there is this function called lockMe that has the following lines to basically hide the ribbon and the nav pane:
Code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo 
DoCmd.SelectObject acTable, , True 
DoCmd.RunCommand acCmdWindowHide
The database opens up with frm_main and the open event includes:
Code:
lockMe 
tbnuid.SetFocus
(tbnuid being the text field which the scanner will dump the data after scanning the ID card)

When I open up the database the cursor appears at the tbnuid field as it should.
Now the problem happens when I click on the form reset button on the form. The form reset button has the following code in the on click event:
Code:
Application.Echo False  
Me.tbstatus = ""  
Me.tbnuid = ""  
Me.loginbutton.Enabled = True 
Me.reportmenubutton.Visible = False   
lockMe  
Application.Echo True  
Me.tbnuid.SetFocus
When I click on the reset button, fields are cleared out as it should and the form is returned to its original state, but the cursor does not appear in the tbnuid field. I have checked
Code:
msgbox (activecontrol.name)
and it gives me tbnuid.

Troubleshooting:
I have isolated the problem code in the reset button by disabling lines of code to the lockMe function, clicking the button without the lockMe has the cursor appearing again in the tbnuid field. Then I went into the lockMe function and disable each line of code one by one to find the culprit and it has to do with the last two lines that hide the nav pane.
I tried editing
Code:
DoCmd.SelectObject acTable, , True
to
Code:
DoCmd.SelectObject acTable, "checked_in" , True
(checked_in being one of the tables in my DB) and try scanning an ID card even with the missing cursor from tbnuid field after clicking reset, and it opened up the checked_in table!

So my guess is that somehow the pointer or whatever focus remains with the nav pane and never returned. Sometimes after repeatedly clicking on the reset button (mostly out of frustration:banghead:) I can see the blinking of the cursor in the tbnuid field before it disappears.



This is really frustrating as I want the cursor to be at tbnuid field before the user scans themselves in. I have tried me.repaint, rearranging the lines of code all up to no avail. Bare in mind that lockMe works elsewhere except here :confused:Any help will be greatly appreciated.
 

Users who are viewing this thread

Back
Top Bottom