Results 1 to 9 of 9
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    237

    unbounded form


    Hi to all,
    I have a bounded form that show a selected record (single view). The form is based on a query with calculated fields. This form has a command button.
    What I want is when the user press the command button, an unbounded form will open and some fields to be copied to that new unbound form.

    How can this be done

    Khalil

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    its so much more work to use an unbound form with data.
    why not just bind the query to the form and no more effort needed?

    otherwise you must program every field to get pasted into every text box. A bound form does all this for you.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    In the OnOpen event of the new form you can use:
    Me.txtControl1=Forms!frmFirstUnboundForm!txtContro l1
    Me.txtControl2=Forms!frmFirstUnboundForm!txtContro l2
    .......
    Cheers,

  4. #4
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    237
    Hi again,
    Thank you for the reply.

    What I am doing is the following:
    I have two tables: table1 and table2; I select a specific record from table1 (a certain item) copy the data to a new for. On the new form I will have a combo box that allowes me to select specific record (a persons name) from table2. than I have to add more fields to the data and store the result in a query. The query represents a many-to-many relation ship (3 tables involves).

    I am now in stage one were i want to copy the fields from the table1. Then I need to select the name from a combo box on the new form with source from table2, fill the necessary fields and then save the record
    I was not able to do this in bounded forms.
    Khalil

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    So do you think the solution I gave you would work?

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    237
    Yes Gicu
    I already did it.
    Now I want to add the values in that form to the query after filling the rest of the fields with the required data

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    So what have you tried? If your form is unbound you will need to use recordset.AddNew to add to the table/query. Is your 3-table query updatable? You might need to add the data to the individual tables instead, keeping in mind that you need to probably retrieve the newly created primary key (if using autonumbers) to use in the foreign key field of the next table.

    If you want to you upload a small sample of your db so we could have a look.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    237
    Hi Gicu,

    I need to add data to one table only I will be using the following code: (a command button)

    Dim strSQL As String
    strSQL = "INSERT INTO tblBorrowedBooks (DateBorrowed, fkBookId, fkMemberId)"
    strSQL = strSQL & " VALUES (' " & Me.txtDateBorrowed.Value & " ', ' " & Me.txtfkBookId.Value & " ', ' " & Me.cboMember.Value & " ') "


    I am missing the use of "recordset.AddNew " procedure. How to do it?

    Thanks

  9. #9
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Suming a calculated unbounded control
    By George in forum Reports
    Replies: 1
    Last Post: 09-13-2017, 09:51 PM
  2. Using a unbounded Datasheet form
    By George in forum Modules
    Replies: 9
    Last Post: 09-04-2017, 01:38 PM
  3. unbounded Combo box
    By Khalil Handal in forum Forms
    Replies: 2
    Last Post: 06-24-2016, 11:51 PM
  4. Replies: 1
    Last Post: 12-09-2015, 10:23 AM
  5. Unbounded combo box
    By wasim_sono in forum Programming
    Replies: 3
    Last Post: 01-26-2006, 10:14 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