Results 1 to 2 of 2
  1. #1
    Mohamed is offline Novice
    Windows XP Access 2000
    Join Date
    Sep 2011
    Posts
    17

    Recordset returning blank value

    Hi I wonder if anyone can help.



    I have created a Recordset to populate a field on a form from a table in the database.

    Basically I have database which holds passwords for laptops. What I want is that when a new record is added into the database the password is automtically selected from a table in the database. (This table is basically a list of passwords).

    I have created a Recordset im hope of acheiving this, however when I run the recordset it does not put the password into my desired textbox.

    How would I achieve this?

    The code is below

    Private Sub Command115_Click()
    Dim db As Database
    Dim rs As Recordset
    Set db = CurrentDb()
    Set rs = CurrentDb.OpenRecordset("SELECT [Password] FROM [tblpasswords] WHERE EncryptionID ")
    With rs
    While Not .EOF
    Debug.Print ![Password]
    .MoveNext
    Wend
    End With
    End Sub

    Thanks

  2. #2
    Mohamed is offline Novice
    Windows XP Access 2000
    Join Date
    Sep 2011
    Posts
    17
    To make myself more clear of what I am trying to acheive.

    I have table consisitng of strings. i.e

    Table Name = Passwords
    Blue1
    Blue2
    Blue3
    Blue4
    Blue5 etc.

    I have a form which holds details of a laptop. I have a text field on this form call Passwords. I have a command button next to this field. When I click this button I want it to select the next available value from the above table.

    So in the previous record, if the laptop has the password 'blue2'. When i create the next new record I want the password to be 'Blue 3'.

    I have compiled the code above in hope to achieve this

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Returning PK after append?
    By MikeMairangi in forum Database Design
    Replies: 5
    Last Post: 08-18-2011, 04:28 PM
  2. Recordset not returning records
    By TinaCa in forum Programming
    Replies: 3
    Last Post: 08-03-2011, 09:26 AM
  3. Replies: 4
    Last Post: 05-11-2011, 03:06 AM
  4. Replies: 1
    Last Post: 11-13-2009, 03:03 AM
  5. Replies: 1
    Last Post: 09-05-2008, 12:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums