access help needed

mother1

New member
access help needed

Dear Forum , I´m new to access .What i want to do is build a db of custormers , that the CustID is the index . If I enter a nre ID , i get a new form to enter ´ new customer details´. If customer alread there , i get its card to update the dtails. Sorry for my lame question , but can access give me that solution? pop up a form to my need and pop another form to other need? any relevant info is welcome, Thanks .
 
אז זה הקוד שאתה צריך

Private Sub number_AfterUpdate() Dim iID As Integer iID = Me![Number] Me.Undo ´ מעבר לרשומה קיימת If DCount("[number]", "details", "[number]=" & iID) = 1 Then DoCmd.GoToRecord , , acGoTo, iID Else If MsgBox("מספר תלמיד לא קיים, האם לפתוח רישום תלמיד חדש", vbInformation + vbYesNo + vbDefaultButton2, "מעבר לתלמיד חדש") = vbYes Then DoCmd.GoToRecord , , acNew Else DoCmd.GoToRecord , , acFirst End If End If End Sub​
 
למעלה