Open form, filter = last record.

johndoomed

VBA idiot
Local time
Yesterday, 19:32
Joined
Nov 4, 2004
Messages
174
Hi again friends!

A quick question. I've made a code that inserts a record to a table. How do I open a form showing that record?

This is my insert code..
PHP:
    With CurrentDb.OpenRecordset("Notater")
        .AddNew
        ![Kunde_ID] = varCust
        ![Faktura_ID] = varFakt
        ![Site_id] = varSite
        ![Emne] = varEmne
        ![Dato] = Now()
        ![Person] = varPerson
        
        .Update
        .Close
    End With

Note: I want the form to open within this click event.
 
Hello,

Something like this should work:

Dim stDocName As String
stDocName = "frmYourForm"

DoCmd.OpenForm stDocName, acNormal
DoCmd.GoToRecord , , acLast
 

Users who are viewing this thread

Back
Top Bottom