Results 1 to 3 of 3

Thread: HELP!!!!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    1

    Post

    I am new to vb, and I am currently developing an application accessing an Access database. I don`t know how to create a SAVE command, and I would also like to search the database and display a message when the desired record is not found.

    Can somebody tell me how to do thisÉ Thanks.

    Tiger

  2. #2
    Guest

    Post

    Please type 'save' (find) at Demo project you will find a lot of Demo program.


    -Khamal-

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Post

    Hope this can help you.

    Set Wrk = DBEngine.workSpace(0)
    Set Db = Wrk.Opendatabase("<Your Database>",False,False)

    Set Rs = Db.OpenRecordset("<Your Table>", dbOpenDynaset)

    :Problem 1:
    With Rs
    .AddNew
    !<Your Field Name> = <Your Value>
    .Update
    End With


    :Problem 2:
    If Rs.RecordCount = 0 Then MsgBox "No record found.", vbInformation + vbOKOnly

    Rs.Close
    Wrk.Close
    Db.Close
    Set Rs = Nothing
    Set Wrk = Nothing
    Set Db = Nothing

    _____________________
    Chris.C
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width