Search results

  1. J

    Please help with Form & possible dlookup

    Would it be possible for you to post a copy of your database with any sensitive data removed or altered? It would be a lot easier to have a database to work with to troubleshoot the code. BTW, I volunteer my time to assist others on the forum, so I do not expect or accept any payment.
  2. J

    need some help here with using a form to lookup data

    You mentioned a products table in your initial post but you provide field names for a components table. Are products and components the same thing? The most important question at this point is whether an order can consist of more than one product/component. BTW, normalization should be...
  3. J

    Please help with Form & possible dlookup

    This would be the code to also check to make sure the user does not try to assign an already assigned locker to a student. IF DCount("*","StudentInformation", "location = '" & me.LocationCBO & "' AND " & lockertype='" & me.TypeCBO & "' AND [number]=" & me.NumberCBO & " AND StudentID is null")=1...
  4. J

    Please help with Form & possible dlookup

    Regarding the above, no message is returned if the user attempts to assign a studentID to an already assigned locker. We would need an additional check and message to handle that if that is what you need.
  5. J

    Please help with Form & possible dlookup

    Actually the code I provide is logically incorrect. The DCount() checks to see if a record exists with the particular studentID . If there is a studentID present (DCount>0) it updates, but that is not correct. What really needs to happen is if the studentID is not present (Dcount =0) then...
  6. J

    need some help here with using a form to lookup data

    What type of information is in the billing and Vat tables? Further, if a customer can place an order for many products (not just one) that describes a one-to-many relationship between orders and products. Further, I assume that a product may be on many orders, so another one-to-many...
  7. J

    Trying to get pk into fk field

    The table structure looks OK. As to the form, you have to use a subform based on the junction table in order to add records to the junction table. Again, typically you would use a combo box in the subform to populate the complainants for each complaint. If you do not want to use a combo box...
  8. J

    Please help with Form & possible dlookup

    So you are talking now about another form, not the one we have been working on, correct?
  9. J

    creating bridge-table records

    The subform should be based on the junction/bridge table NOT the certification table. You will need to add a combo box to the subform. That combo box should have the certification table as its row source.
  10. J

    DLookUp runtime 2471

    What is the datatype of the field WkEnd? If it is a date field then you need this lookup = DLookup("[GOEnd]", "[WatEngDataWeek]", "[WkEnd] = #" & WkEnding & "#") If it is a number then you need this: lookup = DLookup("[GOEnd]", "[WatEngDataWeek]", "[WkEnd] =" & WkEnding) If it is a text...
  11. J

    creating bridge-table records

    Considering that your list of certifications will probably not change much over time, I would recommend putting a subform based on the EmployeeCert (join) table on the employee form (I assume that your employee form is bound to the employee table). If you have your relationships established in...
  12. J

    Trying to get pk into fk field

    No it would not make things easier, and it would violate normalization rules. If there can be many complainants associated with a complaint (one-to-many) and a complainant can be associated with many compliants (one-to-many) that describes a many-to-many relationship which is handled with a...
  13. J

    Trying to get pk into fk field

    Since based on your table structure, there can be only one complainant per complaint trying to enter the complainant information via a subform is not the appropriate way to handle it. As I indicated earlier, subforms are used for the many side of a one-to-many relationship i.e. one complaint...
  14. J

    Trying to get pk into fk field

    If you use a text box, you will have to be able to search your existing complainants to find the closest match and then you will also have to give some feedback to your user to have them confirm what you found. Once confirmed, then you can go get the ID a push it to the control on the form...
  15. J

    Please help with Form & possible dlookup

    You can add embed the code I gave you in an IF..THEN...ELSE...END IF statement that tests whether a studentID exists, if it does, do the update. If it doesn't, open the appropriate form. (The following code has not been tested): IF Dcount("*", "StudentInformation","StudentID=" &...
  16. J

    Trying to get pk into fk field

    If you look at the row source of the combo box, it is just a query. You can add any necessary criteria to that query to accomplish the filtering. I assume that you need to limit the list in the combo box to certain choices. Even then, a user can make a mistake and select the wrong one. How...
  17. J

    Please help with Form & possible dlookup

    I see I forgot an & and a double quote, my apologies QL="Update LockerInformation set studentID=" & me.studentIDtxtbox & " WHERE location = '" & me.LocationCBO & "' AND " & lockertype='" & me.TypeCBO & "' AND [number]=" & me.NumberCBO
  18. J

    Trying to get pk into fk field

    How many complaintants are related to the complaint, one or many? From the table structure you show, it appears that a complaint only has one complaintant So if one complaintant is related to a complaint, the main form should be based on the complaint table and you would use a combo box bound...
  19. J

    Calculations Using Aggregate Data

    I would typically build a second query that pulls the necessary information from the aggregate query and do the calculation in the second query.
  20. J

    Need help on relationship tables

    Since your finished goods are just a mixture of other finished goods and/or raw materials, all materials should go in 1 table tblMaterials -pkMaterialID primary key, autonumber -txtMaterialCode -txtMaterialDescription -fkClassID foreign key to tblClassification -currCost -longLotSize -fkUoMID...
Back
Top Bottom