Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Hello1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    32
    Ok will do, any suggestion for a suitable title?

    I have one more problem, guess no need to open another thread will just include it in the title because its similar.


    Everything is same just this time in the form employees I have a subform which contains the CompanyID (So no more CompanyID in Employees). I cant figure it out, I get again the error to enter parameter values and when I enter the CompanyID values it shows the correct results for that CompanyID.

    Code:
            DoCmd.OpenForm "frmEmployees", , , "Forms!frmEmployees.sbfWorkplace.Form.CompanyID=' " & Forms!frmMain.cboCompanyID & " '"
    Code:
            DoCmd.OpenForm "frmEmployees", , , Forms!frmEmployees.sbfWorkplace.Form = "CompanyID=' " & Forms!frmMain.cboCompanyID & " '"

  2. #17
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Sounds like an unusual setup. Normally the main form is based on the table with the primary key and the subform based on table with the foreign key pointing to the main table.
    I assume there's a table for workplace. If workplace table has no foreign key pointing back to tblEmployee, then there's no logical relationship between them.
    Can you post an image of your table relationships?
    Last edited by davegri; 12-21-2018 at 04:47 PM. Reason: clarif

  3. #18
    Hello1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    32
    Will need a while to translate all that (I will do it tomorrow then if i dont figuriere it out by then), but its not really a subform of employees form, i just wrote it like that so I dont have to change everything and we could relay on the previous posts.

    Its actually something like this.
    Navigation form (previously i called it Main form) -> Another navigation form -> Workplace form which contains a main form which is something like a rule book and some fields about it, and a sub form in it which is called workplace it includes a workplace name, required degree, CustomerID (so I can filter workplace by company), and some other stuff.

    Anyway, I want to do the same as we did previously just this time the customerID is in a subform so Im not sure did I write the code correctly, did I refer to the customerID correctly. If I did I will check my relationships and the tables, research a bit more to find out the mistake, if I dont manage to I will come here with more information
    Just for now I would like to know is the code correct when referring to an item (this case CustomerID) in the subform and a form which is not related to it?
    Sorry for the trouble, from now on I will try to explain the problem in as much details as I can, and thanks again

  4. #19
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    If you are using navigation forms and subforms, and want to relate data between them, count me out. If faced with that problem and tasked to make a workable database, I would start over without navigation forms. Good luck.

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I also do not like the intrinsic Navigation form and have never used. Perhaps what you are calling a navigation form is just a normal form with command buttons to open other forms.

    Provide the revised database.

    Don't worry about the thread title.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Dynamic Filtering on Forms
    By tonygg in forum Forms
    Replies: 3
    Last Post: 11-11-2015, 02:56 PM
  2. Filtering in Forms
    By djclntn in forum Forms
    Replies: 7
    Last Post: 03-21-2013, 05:30 PM
  3. Filtering Forms
    By Lupson2011 in forum Forms
    Replies: 1
    Last Post: 02-07-2012, 04:48 PM
  4. Filtering Forms
    By Iggsy in forum Forms
    Replies: 6
    Last Post: 11-23-2011, 01:01 AM
  5. Combo Box Filtering between Forms
    By andrew_ww in forum Access
    Replies: 3
    Last Post: 12-30-2009, 11:06 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