Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by ssanfu View Post

    ...BTW, I would use queries for the record sources of the form...If you use tables, the data won't/can't be sorted.)
    While I always use Queries as the basis for Forms, for a variety of reasons, Forms based directly on a Table can certainly be sorted, using the Form's OrderBy Property.



    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  2. #17
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Add "DeptID_FK" to the "Location" table.

    The SQL for "cboLocation" would be:
    Code:
    SELECT LocID, Location FROM Locations WHERE [DeptID_FK] = Forms!YourForm.cboDepartment
    ("cboLocation")
    Bound Column =1
    Column Count = 2
    Column Widths = 0 'hides the first column

    The After Update event of cboDepartments should have
    Code:
     Me.cboLocation.Requery
     Me.cboLocation = null

  3. #18
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Thank you very much for your help.
    I am just curious about table Location.
    there are different locIDs for same Location.
    like 1 for Factory A
    and then 4 is also for Factory A.
    So is it Ok for quaries filtering or some other programming?

  4. #19
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I made up some data to demonstrate the different locations based on selecting different departments.

    You said: "I want that first I will select department from combo1 then Location so it should show me records of that department and location."
    So one department can have (be in) many locations.

    If you want a list of unique locations, you would use: "SELECT DISTINCT LocDesc FROM Locations ORDER BY LocDesc"

    In a query, going from Orders to location and department, there will be one Location.LocDesc for each Order.LocID and one Department.DepartDesc for each Order.DeptID.

  5. #20
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    I think my main problem is in table relationships.The design which I want I can draw on paper but
    I can't make it in access.So here I am attaching my design and a sample database.
    Please you make table relationships for me in that style which I draw.
    Thanks

  6. #21
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Not sure how this will act/look in Access 2012. Tried to keep it like looking like shown in your attachments.
    The combo boxes for Items and UOM (??) do not have a row source - probably need additional tables.
    I used different BG colors to show which sub form was which. Dates could have display formats added.....

    Personal comment:
    I don't like the sub-sub form arraignment. I would use list boxes with additional forms to add data. But this is your project.

  7. #22
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Yes everything is working fine.
    but the two combo boxes "Department" and "Location" is not filtering records.
    I am working on this. If not solve from me then I will ask you.
    Last edited by glen; 10-24-2012 at 02:09 AM.

  8. #23
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    I tried my best but could not solve this problem.
    the two combo boxes Department and Location not showing their related records.
    and in your sample database these two combo boxes are not showing in form mode So that I check that in your
    sample database it working or no.
    but I checked in design mode and applied the same procedure in my database but not working.

  9. #24
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    but the two combo boxes "Department" and "Location" is not filtering records.
    Don't understand. They are not for filtering, they are for entering data.

    Do you want to post your Access 2010 dB?

  10. #25
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    I am so sorry.
    due to my poor English I can't explain properly that what I want.
    Actually these two combo boxes are not for entering data.These are only for filtering to show data of form "deliveries" and "orderdetail".
    If I want to make new order for some different department and location then I will make new order from some other form.
    I will use only deliveries and orderdetail form here for entering new data in existing Departments and Location.
    Suppose I make an order for department "Production" in Location "Factory" then next time I will never make new order for this department and location.
    In deliveries serial 1 I will send items in orderdetail.
    Next time if I want to send items in this department and location.I will just select "Production" from combo "department"
    and "factory" from combo Location. So it will show me all previous records.Now if I want to send other items in this order I will just click on New blank record
    of form "deliveries" so it will jump to serial 2 in same order but only serial will change.before I sent items in serial 1 and now I will send in serial 2.
    and department, Location and Order no. will always remain same.
    Note: If you check my drawing in post no. 20 which I made for table relationship there I show what I want.

  11. #26
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Been very busy...

    Took a while to understand what you were trying to do. Had to change some record sources (from tables to queries).

    I added a couple of records to Department: "Finishing" , so there are test records for Departments Delivery & Finishing.

    See zip file...

  12. #27
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Thanks for your reply.
    Ok I will check then I will reply.

  13. #28
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    I checked all. It is exactly the same which was in my mind.
    Thank you very much.
    My problem solved.

  14. #29
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Mr. Ssanfu you put this expression for Serial number :=IIf(IsNull([Forms]![ORDERS].[ORDERID]),0,Nz(DMax("serialNO","DELIVERIES","ORDERID = " & [Forms]![ORDERS].[ORDERID]),0)+1)

    which related to order id. when we put order date it will show serial 1 in serial number.
    I want to relate it with delivery date so for this i create this expression but it is not working plz you check that where is problem.


    =IIf(IsNull([Forms]![SUBFORMDELIVERIES].[DELIVERYID]),0,Nz(DMax("serialNO","DELIVERIES","DELIVERYID = " & [Forms]![SUBFORMDELIVERY].[DELIVERYID]),0)+1)

  15. #30
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Ahh Ok My problem solved.
    I just put this code in subformdelivery before insert event and it working fine for me.
    serialno = Nz(DMax("serialno", "deliveries","OrderID=" & Forms!Order!OrderID)) + 1

    Now I want that when ever I click on New (blank) Record of sub form deliveries then it should give me message that
    " Enter Delivery Date First"
    I have little bit idea that len expression will use for this.
    But I don't know in which event I have to put this.
    I tried in sub form deliver before event but it is not working.



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

Similar Threads

  1. Designing Form (Beginner)
    By ccordner in forum Forms
    Replies: 1
    Last Post: 01-17-2012, 12:02 PM
  2. Help designing a group update form
    By 10 Gauge in forum Forms
    Replies: 22
    Last Post: 03-28-2011, 10:30 AM
  3. Designing Reports
    By jlclark4 in forum Reports
    Replies: 3
    Last Post: 02-28-2011, 01:46 PM
  4. Designing Form
    By Kookai in forum Forms
    Replies: 0
    Last Post: 07-30-2010, 11:03 AM
  5. Help Designing Tables
    By sakthivels in forum Database Design
    Replies: 7
    Last Post: 06-09-2009, 07:48 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