Create a customer form in Access

Опубликовано: 07 Июль 2026
на канале: Lic. Bolívar Ramírez
12,681
235

IN THIS VIDEO YOU WILL LEARN HOW TO CREATE A CUSTOMER FORM IN ACCESS

1- Form Code

Private Sub Form_Open(Cancel As Integer)
Me.LstClientes = Me.Id
End Sub

2- Code to select data from the list box

Private Sub lstClientes_Click()
Me.Filter = "Id = " & Me.LstClientes
Me.FilterOn = True
End Sub

3- Text Box Code

Private Sub txtBusqueda_Change()
Dim SQL As String
SQL = "SELECT Id, Names FROM Tbl_Clientes WHERE Names LIKE '*" & Me.TxtBusqueda.Text & "*'"
Me.LstClientes.RowSource = SQL
End Sub

4- New Button Code

Private Sub btnNew_Click()
DoCmd.GoToRecord , , acNewRec
Me.LstCustomers = Null
Me.LstCustomers.Requery
End Sub

5- Save button code

Private Sub btnGardar_Click()
DoCmd.RunCommand acCmdSave
Me.LstCustomers = Me.Id
Me.LstCustomers.Requery
End Sub

6- Cancel button code

Private Sub btnCancel_Click()
DoCmd.RunCommand acCmdUndo
Me.LstCustomers.Requery
End Sub

7- Delete button code

Private Sub btnDelete_Click()
DoCmd.RunCommand acCmdDeleteRecord
Me.LstCustomers.Requery
End Sub