Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    keviny04 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    128
    QuantifyRisk,

    I remember you said you had two SEPARATE forms, one for searching and one for data entry. In that case, you do need a bit of code to pass info from the search result to the data entry form. I attached a modified version of Browne's form here: search2000.zip

    You open the client search form, search for a client, select a client, then click the "Edit Client" button that I made. It will open a data entry form with the client's info. Is this what you want? In that case, the button's OnClick event is simple:

    DoCmd.OpenForm "frmClient", , , "[ClientID]=" & Nz(Me!ClientID, -999)

    The Nz() function is to trap null value of ClientID. (This is due to Browne's decision to always return at least one search result, a row of null values, even when nothing is found. To me, this is a questionable move that would confuse the user. If nothing is found, the search result should show an empty list. But it would take additional code to do that.)

    For this to work, frmClient must be bound to the Client table. If you want to see data from other tables included on the form, then frmClient must be bound to a query that joins all those tables together, as I suggested.

    You said you didn't want to use the search form while entering data. Then just make the data entry form MODAL. The user won't be able to leave the data entry form until it is closed.
    Attached Files Attached Files

  2. #17
    QuantifyRisk is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    65
    I cannot open the attachment at work. But how can I do this:

    "If you want to see data from other tables included on the form, then frmClient must be bound to a query that joins all those tables together, as I suggested."

    Are we talking joins here? Never done one before.

  3. #18
    keviny04 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    128
    Quote Originally Posted by QuantifyRisk View Post
    I cannot open the attachment at work. But how can I do this:

    "If you want to see data from other tables included on the form, then frmClient must be bound to a query that joins all those tables together, as I suggested."

    Are we talking joins here? Never done one before.
    Yes, you need SQL that joins tables together. For instance, I added a "Level Description" column to Browne's form:

    Click image for larger version. 

Name:	frmClientSearch.jpg 
Views:	7 
Size:	95.0 KB 
ID:	20474

    Since the Level Description field (actual field name is "Level") is in another table, you need this SQL for the form's control source that links to that table:

    SELECT tblClient.*, tblLevel.Level FROM tblLevel INNER JOIN tblClient ON tblLevel.LevelID = tblClient.LevelID;

    ...instead of just tblClient that was before.

  4. #19
    QuantifyRisk is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    65
    That's awesome. Thank you.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Related Tables
    By roybb in forum Database Design
    Replies: 5
    Last Post: 08-27-2014, 03:30 PM
  2. Create Tables on load
    By tristandoo in forum Programming
    Replies: 6
    Last Post: 02-07-2014, 10:43 AM
  3. Replies: 5
    Last Post: 12-14-2012, 04:21 PM
  4. 3 Related Dependent Tables
    By jbarrum in forum Access
    Replies: 0
    Last Post: 11-17-2009, 11:27 AM
  5. Load tables name and fields name to list box
    By casseopia00 in forum Programming
    Replies: 1
    Last Post: 06-30-2009, 10:09 PM

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