Change the error description-Urgent

  • Thread starter Thread starter Liora
  • Start date Start date
L

Liora

How can I add a message of my own instead of the system -
or I can stop the err message of the system.
For example: in combo box - event not in the list - I
enterd a macro with a msg box - but after that the System
message of the not in the list is appear.

thans
Liora
 
Hi there

You can do this by going in the vb editor and using the
MsgBox function on the module that you want to run

eg:
Private Sub Command62_Click()

Dim Msg, TITLE, Response

Msg = "Remember that Monthend for this month must be
run for these figures to be accurate!"
TITLE = "Caution!"

Response = MsgBox(Msg, vbOK, TITLE)
If Response = vbOK Then
DoCmd.Close
DoCmd.OpenForm "MonthlyStats"
Else:
DoCmd.CancelEvent
End If



End Sub

OR

Private Sub Combo106_AfterUpdate()
On Error GoTo Err_Combo106_AfterUpdate
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[peopleID] = " & Str(Me![Combo106])
Me.Bookmark = rs.Bookmark

Exit_Combo106_AfterUpdate:
Exit Sub

Err_Combo106_AfterUpdate:
MsgBox "There are no records that meet with your
criteria"
Resume Exit_Combo106_AfterUpdate

End Sub
 
thanks for your help.

I have more 2 problem :
1- I define a field as text - I entered data like :
A1,A2,A3,A4,A10,A11,A12,A21
When I watch at the list at a combobox list and is
sort by this fields: the order is:A1,A10,A11,A12,A2,A21
how can I change the order to : A1,A2...A10...


2-I work with access XP - I want to write a function to
check if value exist at table using the "seek" command

I receive an error massage when I def :
dim db as database ----> error - no exist
dim r as recordset
set db=currentdb
set r=db.recordses(table,,...)
r.primerykey
r.seek
I r.nomatch...----> error not exsist

I used those command before at access 2000 - is there
any problem.

Liora
 
Liora,

You're welcome.

It would be better to let this thread terminate and to post your other
issues as separate posts.

hth
 
Back
Top