Hi All,
I have a text box on a form where a User can type in a name of a unit and expect to jump to the record containing that unit.
I use the very simple code:-
docmd.gotoontrol "Units"
docmd.findrecord TextBoxName
This works fine if the unit is found, however if the unit is not found then the cursor just jumps to the record thats on the screen at the time.
That is going to cause some problems with data being added to records incorrectly (Basically because the cursors moved so the user thinks its found the record, they don't bother checking to see if its the right record)
What I need to be able to do is put up a messagebox to say record not found and this is where I'm stuck.
I found one thread on Tek-Tips that recomended using DCount to do this, but I couldnt get it to work whatever I tried.
If anyone has done this before or knows a better way of doing it, could you please help me.
For Clarities sake
Table : DataCapture
TextBox : SearchOne
Field : UnitName
Many thanks in advance
ModeX
I have a text box on a form where a User can type in a name of a unit and expect to jump to the record containing that unit.
I use the very simple code:-
docmd.gotoontrol "Units"
docmd.findrecord TextBoxName
This works fine if the unit is found, however if the unit is not found then the cursor just jumps to the record thats on the screen at the time.
That is going to cause some problems with data being added to records incorrectly (Basically because the cursors moved so the user thinks its found the record, they don't bother checking to see if its the right record)
What I need to be able to do is put up a messagebox to say record not found and this is where I'm stuck.
I found one thread on Tek-Tips that recomended using DCount to do this, but I couldnt get it to work whatever I tried.
If anyone has done this before or knows a better way of doing it, could you please help me.
For Clarities sake
Table : DataCapture
TextBox : SearchOne
Field : UnitName
Many thanks in advance
ModeX