HELP!! I'm A VBA VIRGIN!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pearl
    New Member
    • Aug 2006
    • 1

    #1

    HELP!! I'm A VBA VIRGIN!!

    Could anyone help me...I've decided to take on vba...by myself...and i don't seem to be very successfull at it...firstly..h ere's a form which i did in access...is the code correct? and if so...how in the world do I display my SQL results in a text box... do i use a read command?? Please help.

    Option Compare Database
    Option Explicit

    Public Sub GetInfo()

    Dim conCurrent As ADODB.Connectio n
    Dim strsql As String

    Set conCurrent = Application.Cur rentProject.Con nection

    strsql = "SELECT conf_act, conf_date FROM Conf;"

    conCurrent.Exec ute strsql

    Dim txtUsername
    Dim txtConf, txtdate, txtact

    txtUsername = [txt_username]
    txtConf = [txt_conf]

    txtdate = conCurrent.Attr ibutes.conf_act

    conCurrent.Clos e
    Set conCurrent = Nothing

    End Sub

    Private Sub cmd_search_Clic k()
    GetInfo

    End Sub
Working...