Results 1 to 11 of 11
  1. #1
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28

    How to bound a text box


    Background: I have mysql 5.1 installed on my server as the back end of my database and trying to use ms access 2003 as a front end. I have been able to successfully connect to mysql and create forms using the wizard but when I try to create a form in design mode I can't seem to select a control source for a text box. So whenever I enter text in a textbox it doesn't update the database. I notice when using the wizard it asks which tables to use is there some way to set which tables your form will be using in design mode? All suggestions much appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    The Record Source property of the form determines what table/query it is bound to. Once that is set, the Control Source of your textbox can be set to the appropriate field within that table/query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    Thanks for the fast reply, that seems to work if I set the resource to one of my tables but as soon as I use multiply tables everything in my form disappears including labels?? Doesn't make sense the label is not even bound by anything??

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    When you use a query instead of a table, you run the risk of creating a read-only recordset:

    http://allenbrowne.com/ser-61.html

    Depending on your structure, you likely need subforms rather than one query with everything in it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    Thanks Again, I have narrowed the problem down but a subform isn't working either.
    I have a client table that contains a client_id INT and several other data types and I have a med_alert Table that has a med_alert_id INT and a med_alert VARCHAR(64) and I have a client_alert table which contains a client_id INT and a med_alert_id INT I was hoping to include these tables on my form. themed_alert table to list all possible alerts and the client_alert table to insert any alerts this client has??

    Does that makes sense or am I going about it all wrong??

    Many Thanks for your help.

  6. #6
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    Ok feeling confused. Can someone tell me if I'm even on the right track please.
    Plan:

    Tables

    Client (
    Client_id (auto)
    Name
    Ethnic_id
    Address_id
    );

    Ethnic (
    Ethnic_id (Auto)
    Ethnicity
    );

    Address(
    Address_id (Auto)
    Home Address
    Phone
    Cell
    );

    Now is it possible to have a form that has three tabs on it called Client, Ethnic,Address. And if I Enter values into some/all of these it will update my tables.

    ie if I enter the name Bob under the client and thats all it will add a new client will the name bob and nothing for ethnic_id and address_id and if I then tab over to address and enter in an address it will create a new address entry and update the client bob to have a matching address_id?

    Thanks

  7. #7
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    Ok I think I have found what part of my problem is. The auto incremnet type from my mysql database tables are not being carried over to access and are being replaced as just a number not an auto number and since its a linked table I cannot change them

  8. #8
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    PLEASE HELP!!!!!!!!!

    The auto generated number is driving me insane!!!!!!!!

    mysql is set to auto increment the client_id so of course on the frontend(ms access) it is unknown at the time of insertion, but I need that as I use it on the form to set the foriegn key of another table. Everything works fine if I manually set the Client_Id, but I really don't want to do this as I would a way of looking up a value that could be used as an id.

    Is there a way of automatically setting a field on a form in ms access to the next number in a mysql table.?

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    If you force a save of the record you should get the number. Try one of these:

    DoCmd.RunCommand acCmdSaveRecord
    or
    If Me.Dirty Then Me.Dirty = False
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    bundy75 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    28
    You are the man!!!!!!!!!!!!!:d

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Excellent! Glad we got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. bound Hyperlinks
    By lazrus55 in forum Access
    Replies: 0
    Last Post: 06-03-2010, 08:10 AM
  2. Replies: 3
    Last Post: 12-03-2009, 04:38 PM
  3. Bound a unbound text box to the table
    By Brian62 in forum Forms
    Replies: 1
    Last Post: 11-06-2009, 11:05 AM
  4. I can't enter text in a bound text box
    By Jerry8989 in forum Forms
    Replies: 3
    Last Post: 10-05-2009, 11:52 AM
  5. inserting bound pictures
    By inquisitive in forum Access
    Replies: 1
    Last Post: 01-09-2006, 09:59 AM

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