Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suddenly have odd cursor behaviour when writing code

Status
Not open for further replies.

RobertIngles

Technical User
Jan 20, 2011
113
CA
I am experiencing weird cursor behaviour when I am writing code in Microsoft Access.

I am writing code for an unbound field BeforeUpdate. I have written most of the code which searches for a matching valuein a table - if the match exists the user gets an error messaging informs them of the match and prompts them to enter a unique value(this performs properly). I am now adding a line that clears the input field when they close the warning msgbox.

Here's where it gets weird;
I am adding the line Me.Undo
When I type Me. the VBA help box appears for a moment and then disappears immediately before I can select "Undo". If I finish the line to ready Me.Undo the Undo does not happen. I tried to enter the line Barcode=" but immediatley the line changes to Barcode="" and my cursor is sitting in front of the two quotation marks.

I have searched for a cause and solution but every answer I found was asking if the form is using a timer (mine doesn't) or if the laptop microphone is active (I don't have one) as apparently these can be the causes of odd cursor/code insertion behaviour.

Can any one help?


'Create var.
Dim intChk As Integer

'This line counts the number of rec instances in TBLLaptop.

intChk = DCount("*", "TBLlaptop", "[Barcode] = '" & Forms!FRM_Create_New_Laptop_Profile_To_Relplace_Refresh!LaptopBarCode & "'")

'Does the rec exist? If not then Move to field Barcode.

If intChk > 0 Then
MsgBox "This LaptopID Already Exists Please Insert a Unique Barcode", vbOK
Cancel = True
Me.Undo

Else
Barcode = LaptopBarCode

End If

Thanks
Robert
 
Hi Duane - I'm no using a timer anywhere in the DB - . I tried re-booting - no luck. If it was happening in other applications I would say hardware but it doesn't.
 
Actuall, I just created a new form and the typing of the coding was normal. Gotta be an anomoly in the form itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top