By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

Popup if serialnumber already in table.

P: 6
I have registration form, that you write serial number and so on.
But i will prevent the user from registrate same thing twice. So if the serialnumber already in the table, then a popup message will tell them so?
How is this possible? Use a invisible button that activate when they pusb enter.
Dlookup?
Help me :)
Mar 21 '07 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
I have registration form, that you write serial number and so on.
But i will prevent the user from registrate same thing twice. So if the serialnumber already in the table, then a popup message will tell them so?
How is this possible? Use a invisible button that activate when they pusb enter.
Dlookup?
Help me :)
Go to the serialnumber field in the table. Set the Indexed property to Yes (No Duplicates). This will not allow the user to enter the same serial number twice.

Mary
Mar 21 '07 #2

P: 6
Expand|Select|Wrap|Line Numbers
  1. Private Sub SjekkRekl_Click()
  2.  
  3. Dim db As Database
  4.     Dim swaptable As DAO.Recordset
  5.  
  6.    Set db = CurrentDb()
  7.  
  8.      Set swaptable = db.OpenRecordset("SWAPkeep", dbOpenDynaset, dbSeeChanges)
  9.  
  10.  
  11.     swaptable.FindFirst "Serienr = '" & frmSerienr & "'"
  12.  
  13.  
  14.     If swaptable.Fields("Serienr") = frmSerienr Then
  15.         MsgBox ("This serialnumber is already in the database.")
  16.         Else
  17.             DoCmd.GoToControl "status"
  18.         Exit Sub
  19.     End If
  20.     End Sub
Just for a little control message. In some few cases we have to use the same serialnumber twice.
But thanks for the answer :)
Mar 22 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
I'm glad you got it working.

Mary
Mar 22 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.