Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net convert Access VBA code to VB.net

Hi. I have the following code in Access VBA. I need to build it in VB.net for my Excel Add in

Function oCreateBatchID() As Long

    Dim oUser As String
    oUser = Environ("USERNAME")

    Dim rs As DAO.Recordset
    Set rs = CurrentDb.OpenRecordset("BatchID")
   
    rs.AddNew
    rs!oUser = oUser
    oCreateBatchID = rs!ID
   
    rs.Update
   
   
    rs.Close
    Set rs = Nothing
   
End Function
SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much