Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2009
    Posts
    16

    Unanswered: How to make Combo Box remember previous value?

    This may seem simple for most of you but i can't figure out how to make my combo box remember the previous value in my Data Entry Form.

    Basically after a record is inserted i just want the combo box to keep that value in the box.

    thanks in advance

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6

  3. #3
    Join Date
    Jul 2009
    Posts
    16
    so which event do i put it on? and which control the command button or the combo box?

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I would probably use the after update event of the combo.
    Paul

  5. #5
    Join Date
    Jul 2009
    Posts
    16
    its still not working, cant figure out why.
    here is what i have

    Private Sub Combo40_AfterUpdate()
    Const cQuote = """"
    Me!Combo40.DefaultValue = cQuote & Me!Combo40.Value & cQuote

    End Sub

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    "Not working" means what? Error, doesn't save the value, ...? Can you post the db?
    Paul

  7. #7
    Join Date
    Jul 2009
    Posts
    16
    Quote Originally Posted by pbaldy
    "Not working" means what? Error, doesn't save the value, ...? Can you post the db?
    database posted, its simple, check your PM for the link

  8. #8
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Both of those functions are working fine for me. I suspect you don't have the database in a trusted location, or haven't enabled code. First item under configuration:

    Microsoft Access tips: Converting to Access 2007
    Paul

  9. #9
    Join Date
    Jul 2009
    Posts
    16
    thanks working now... appreciate it.

  10. #10
    Join Date
    Apr 2009
    Posts
    6
    Hi everyone
    I have a little problem. I have an access database from where i retrieve data. I want to retrieve data into a combo box and still have a list incase i want to update that data. I can only see the data when i click on the combo box and i want it to show when search is executed.

    this is my code
    con.OpenConnection()
    cmd.CommandText = "Select * from cans where CANNUM='" & CboCandNum.Text & "'"
    cmd.Connection = con.con
    dr = cmd.ExecuteReader
    dr.Read()


    cbosubj5.Items.Clear()
    cbosubj5.Items.Add(dr("SUBJCODE5"))

    cbosub6.Items.Add(dr("SUBJCODE6"))

    cbosub7.Items.Add(dr("SUBJCODE7"))

    cbosub8.Items.Add(dr("SUBJCODE8"))

Posting Permissions

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