My form textbox is entering numbers in reverse?

N

Nemesis_uk

Help!, I have an access 2003 database which recently has started
reversing any input. i.e if I enter 23 it shows 32. I have checked
regional settings, and all the form text fields options which appear
correct and an older version of the database works fine despite
showing exactly the same settings as far as I can see. Can anyone
suggest what it might be?

Thanks
 
A

Allen Browne

If it's not the obvious right-to-left settings, is there any code in the
events of the form or its controls that could be affecting this?

Particularly, anything in the KeyDown, KeyUp, KeyPress, Change MouseMove, or
Timer events?

Anything that includes a DoEvents would be suspicious.
 
N

Nemesis_uk

Thanks for replying , It's driving me mad! There is nothing other than
several examples of the following

Private Sub Tie_Break_Change()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

[Score] = [R1] + [R2] + [R3] + [R4] + [R5] + [R6] + [R7] + [R8] + [R9]
+ [R10] + [R11]
End Sub
 
A

Allen Browne

Yes, that could cause the problem.

The change event fires with each keystroke.
In this event, you ar saving the record.
Before the record can be saved, Access must update the Value of the control.
This could have the effect of moving the cursor to the beginning of the text
in the control, so that the next keystroke turns up in the wrong place.

The solution will be to remove the code that saves the record in the
control's Change event. Not sure why you are saving after evey keystroke: at
worst, you would want to save in the AfterUpdate event procedure of the
control, but saving after every control is updated is probably still a poor
idea.

Similarly if Score is a bound control, dirtying the form as soon as it is
saved is once again a bad idea.

(Further, the repeating fields (R1, R2, etc) looks like a spreadsheet rather
than a normalized database.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Nemesis_uk said:
Thanks for replying , It's driving me mad! There is nothing other than
several examples of the following

Private Sub Tie_Break_Change()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

[Score] = [R1] + [R2] + [R3] + [R4] + [R5] + [R6] + [R7] + [R8] + [R9]
+ [R10] + [R11]
End Sub



If it's not the obvious right-to-left settings, is there any code in the
events of the form or its controls that could be affecting this?

Particularly, anything in the KeyDown, KeyUp, KeyPress, Change MouseMove,
or
Timer events?

Anything that includes a DoEvents would be suspicious.







- Show quoted text -
 
N

Nemesis_uk

Thanks Allen, I appreciate it is dirty but it has worked for several
years without proble, why would it start in the last few days? Can't
think what else has changed.
Yes, that could cause the problem.

The change event fires with each keystroke.
In this event, you ar saving the record.
Before the record can be saved, Access must update the Value of the control.
This could have the effect of moving the cursor to the beginning of the text
in the control, so that the next keystroke turns up in the wrong place.

The solution will be to remove the code that saves the record in the
control's Change event. Not sure why you are saving after evey keystroke: at
worst, you would want to save in the AfterUpdate event procedure of the
control, but saving after every control is updated is probably still a poor
idea.

Similarly if Score is a bound control, dirtying the form as soon as it is
saved is once again a bad idea.

(Further, the repeating fields (R1, R2, etc) looks like a spreadsheet rather
than a normalized database.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




Thanks for replying , It's driving me mad! There is nothing other than
several examples of the following
Private Sub Tie_Break_Change()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[Score] = [R1] + [R2] + [R3] + [R4] + [R5] + [R6] + [R7] + [R8] + [R9]
+ [R10] + [R11]
End Sub

- Show quoted text -
 
N

Nemesis_uk

Thanks Allen, That seems to have partially solved the probIem. I have
removed all the on change events and replaced with after change
events. I appreciate my original method is dirty but it has worked for
several years without problem, why would it start in the last few
days? Can't think what else has changed. Now when I enter new data in
the last field I have to click off it or manually update, is there a
way around this?
 
A

Allen Browne

You can force the save in the After Update event of the last text box if you
wish.

Or you can press Shift+Enter to save the record, or use the menu or toolbar.

As to why it suddenly stopped working, that's probably the wrong question.
You might get away with driving to work on the wrong side of the road for
some time, but it's not advisable. The change could be anything that alters
the timing, such as more data, fuller drive, other processes that use CPU
cycles, or updates.
 
Top