Heres a sample on how to add a record to database.

Dim rstInfo As New ADODB.Recordset
Dim SQL as String
SQL = "SELECT * FROM List"
rstInfo.Open SQL, cn, adOpenStatic, adLockOptimistic
rstInfo.AddNew
rstInfo!CustomerName = txtName.Text
rstInfo!ContactNumber = txtContact.Text
rstInfo!Date = txtDate.Text
rstInfo!TimeStart = txtStart.Text
rstInfo!TimeEnd = txtEnd.Text
rstInfo!Event = txtEvent.Text
rstInfo!PossibleNumberofGuest = txtGuest.Text
rstInfo!Comment = txtComment.Text
rstInfo.Update
rstInfo.Close
Set rstInfo = Nothing

Happy coding :D

Put it in your command button which save the data that is input in your controls.

Usually the saving button ( e.g cmdSave).

Replace your module code with this.

Public CN As New ADODB.connection
Public rs As New ADODB.Recordset

Public Sub CON()
With CN
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .ConnectionString = "Data Source=" & App.Path & "\Database1.mdb"
     ' so that you dont have to specify the whole drive path of your database
     ' database should be in the same folder as your app
    .Open
    .CursorLocation = adUseClient
End With
End Sub

Replace your Save button code with this.

Dim rstInfo As New ADODB.Recordset
Dim SQL As String

Call CON

SQL = "SELECT * FROM List"

    rstInfo.Open SQL, CN, adOpenStatic, adLockOptimistic
        
        rstInfo.AddNew


            rstInfo!CustomerName = txtName.Text
            rstInfo!ContactNumber = txtContact.Text
            rstInfo!Date = txtDate.Text
            rstInfo!TimeStart = txtStart.Text
            rstInfo!TimeEnd = txtEnd.Text
            rstInfo!Event = txtEvent.Text
            rstInfo!PossibleNumberofGuest = txtGuest.Text
            rstInfo!Comment = txtComment.Text
            
            
    rstInfo.Update
    
         MsgBox "Record has been Saved", vbInformation
    
    rstInfo.Close

CN.Close
    
Set rstInfo = Nothing

when clicked it does not quickly added into my database i need to close my project then open it again

On your save button code, put this between line 26 and 28.

frmList.Adodc.Refresh
frmList.DataGrid1.Refresh

how about if i click the column header then it will be in order

This question has already been answered. Start a new discussion instead.