Results 1 to 12 of 12
  1. #1
    Join Date
    Sep 2013
    Posts
    12

    Unanswered: Unbound Box to populate field in Table

    Hi everyone

    Does anyone knows how to make an unbound box in a form populate a field in a table.

    I was thinking something like this but it didn't work

    Unbound box name is BoxA

    Me.BoxA.Value = Me.Table1.column(1)

    Those anyone have any suggestions on how to do this?

  2. #2
    Join Date
    Nov 2011
    Posts
    413
    Are you referring to a TextBox ? Then it should be named txtA. Your table should be named tbl1 or tblOne
    Me.BoxA = DLookup("[YourTablesFieldName]", "Table1")


    HTH

  3. #3
    Join Date
    Sep 2013
    Posts
    12
    Hi, thanks for the replay

    But that is the opposite of what I'm looking for

    That populates the onbound text box with a value from a table
    I want to populate a table with a value from a unbound text box

  4. #4
    Join Date
    Nov 2011
    Posts
    413
    Sorry for the misunderstanding. Is this BoxA a ComboBox ?If so, what is the record source and the field names? You did not answer my questions!

  5. #5
    Join Date
    Sep 2013
    Posts
    12
    Sorry, you right!

    The box A is a text box with the default value of Date()
    I want to add the value in that text box to table1 to the field Data_Created

  6. #6
    Join Date
    Nov 2011
    Posts
    413

    Unbound Box to populate field in Table

    Here is an example. I don't know your form or table (Names or Fields) structure so it is a guess. I would need more details to help further.


    HTH
    Attached Files Attached Files

  7. #7
    Join Date
    Sep 2013
    Posts
    12
    Hi, That worked more or less.

    But It updated every row in the main table, except just the row the form was on
    Any ideas on how to fix this

  8. #8
    Join Date
    Nov 2011
    Posts
    413
    How about uploading a scaled down version of your db leaving out all and any confidential data, compiled and zipped.

  9. #9
    Join Date
    Sep 2013
    Posts
    12
    Hi, Sorry for the delay. I have a big drive from the office back home.

    I attached the entire access File
    Please keep in mind that until this week I didn't even know what access was and never even touch a vbscript or any other scripting language!!

    What I'm trying to do is duplicate a record with the date set automatically for the date created.
    If you have the time I will be very grateful if you can take a look at the file and see whats the problem.

    I Still have alot to do.
    I need to create a history of changes when editing a record, have now idea how to go at that.
    And fix the problem in the navigation form that doesn't really work.

    I bet what is taking me a hole day will only take 5 min to a pro.

    Let me know what you think and what changes you would do.
    Thanks so much in advance.
    Attached Files Attached Files

  10. #10
    Join Date
    Nov 2011
    Posts
    413
    That's ok.Glad to Help! Post back in a while.

  11. #11
    Join Date
    Sep 2013
    Posts
    12
    I managed to do it with the code you gave me, thanks so Much

    I created a function with that code and in the save bottom with the macros I run the function.

    Maybe it takes half a second to execute and if it was only code it would take less time.

    But it works great.

    I'm now going to try a similar approach to the create history when edit a record.
    but instead of update query going to create an append query.

    See if it works!
    Thanks so mush for your help

  12. #12
    Join Date
    Nov 2011
    Posts
    413
    Glad to Hear You Got It To Work. Good Luck With Your Project.

Posting Permissions

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