Cutom made message boxes how can we make?

lranganathan

New member
Local time
Tomorrow, 01:17
Joined
Apr 27, 2006
Messages
5
Dear friends,

I am doing a project for data entry and validation in ms access 2000. I want to display the error in data entry in message boxes with different font sizes and colors to show the entered value and the verify entered value. I am displaying the messages in the message box it is ok. But the different font sizes and colors of the font i want to change. any help appreciated.

thanks and regards
LRN
 
You will have to create your own form to display different font sizes and colors.
 
Sir,

I had already created the form with the textboxes controls and command buttons etc.,

What I need is I want to store the Primary number and seek the same from the db and the whole record has to be stored in an array and has to be retrieved field by field for comparison with the data double entered in the form.

bye
LRN
 
What it seems like you want is to check to make sure a duplicate record is not entered into the database.

And if what you mean by "Primary number" is the record ID number then you can either set the table Field not to accept duplicates in the table Field's Index property. Simply set the property to Yes (No Duplicates).

But, if you don't want to go that route then perhaps you can either use the DLookup or DCount function. For Example:

Code:
If DCount("[[COLOR="Red"][I]TableRecIDFieldName[/I][/COLOR]]", "[[COLOR="Red"][I]yourTableName[/I][/COLOR]]", "[[COLOR="Red"][I]TableRecIDFieldName[/I][/COLOR]]='" & _
               Me.[COLOR="Red"][I]MyFormsRecIDFieldName [/I][/COLOR]& "'") > 0 Then
   MsgBox "Hey!...That ID is already taken.", vbInformation, "Duplicate ID"
   Me.Undo
End If

The above is of course assuming that the TableRedIDFieldName is of a Text Data Type. :)

or perhaps use:

Code:
If Nz(DLookup("[[I][COLOR="Red"]TableRecIDFieldName[/COLOR][/I]]", "[[COLOR="Red"][I]yourTableName[/I][/COLOR]]", "[[COLOR="Red"][I]TableRecIDFieldName[/I][/COLOR]]='" & _
                   Me.[I][COLOR="Red"]MyFormsRecIDFieldName[/COLOR][/I] & "'"),"") <> "" Then
   MsgBox "Hey!...That ID is already taken.", vbInformation, "Duplicate ID"
   Me.Undo
End If

Where to put the code? In the the BeforeUpdate event for either the MyFormsRecIDFieldName TextBox or the Form itself. It's better to snag the issue right away and put it into the Data entry Field (MyFormsRecIDFieldName).

Of course you will need to change the names ind red italic to suite your needs.

.
 

Users who are viewing this thread

Back
Top Bottom