Is there a way to clear the keyboard buffer in access vba, something like the clear typeahead command in dbase?
I have a situation where occasionally one of two clicks in a file dialog box is carrying over to the control (a textbox with a click subroutine that launches the file dialog box) resulting in the file dialog box being launched again. I would like to try clearing the keyboard buffer at the end of the click routine to see if it solves the problem.
I am using a text box as a button control on a continuous form so it will display the value in the field as the label for the button. The fields are: Database Label (values "Database1" or "Database2"), Database path.
The code of the click subroutine:
Private Sub txtDatabaseSelectorTableID_Click()
Dim lstrSelectedFile As String
lstrSelectedFile = fSelectFile("InitPathDbase" & [TableID], "accdb")
'Debug.Print lstrSelectedFile
If lstrSelectedFile = "No File Selected" Then
GoTo ExitDatabaseSelectorTableID_Click
ElseIf lstrSelectedFile = "ERROR" Then
MsgBox "File Selection Unsuccessful"
GoTo ExitDatabaseSelectorTableID_Click
End If
Me.txtDatabase.Value = lstrSelectedFile
Me.chkValid = fQuestionnairesMasterExists(lstrSelectedFile)
If Me.Dirty Then
Me.Dirty = False
End If
If Me.chkValid Then
Me.btnLoadTempTable.Enabled = True
Else
Me.btnLoadTempTable.Enabled = False
End If
sDeleteAllRecords "ttblQuestionnairesMasterTemp" ' Delete all records from temporary table as they no longer represent
' databases in tblQMLTablesToCompare table .
Me.btnViewEDC.Enabled = False
Me.Refresh
Me.txtDatabase.SetFocus ' set focus off of select buttons for visual display reasons
ExitDatabaseSelectorTableID_Click:
Exit Sub
End Sub