Search results

  1. J

    Please help with Form & possible dlookup

    Correct, if you have an existing record without the studentID then you would need an update query. My apologies for the misunderstanding. The code would look like this: Dim mySQL as string mySQL="Update LockerInformation set studentID=" & me.studentIDtxtbox WHERE location = '" &...
  2. J

    Please help with Form & possible dlookup

    I had not looked at your attachment, but I see that for two of the three combo boxes, you only have 1 field, so those are the bound fields. I assume that the [number] field in the last combo box is the bound field. BTW, the word number is a reserved word in Access, and it would be best not to...
  3. J

    Use variable as field name in IIf expression

    Glad to hear that you got it sorted out!
  4. J

    Please help with Form & possible dlookup

    Since the form is unbound, it will never save the studentID you enter in the textbox. That is where the append query comes in. I would typically add a command button to the form and then execute the append query in code in the on click event of the button. You would pull info from the 3 combo...
  5. J

    Use variable as field name in IIf expression

    If you concatenate a number to a string the result is a string. The number does not have to be converted prior to the concatenation. What is the name of the control on the form that holds the count? If it is [#Subj], you need the me. shorthand or the full form reference. Further, I would...
  6. J

    Please help with Form & possible dlookup

    You can do a couple of things. 1. In the after update event of the third combo box, push the selected studentID to the textbox me.textboxname=me.thirdcomboboxname.column(x) where x= the number of the column that holds the studentID. Access starts counting the columns at 0 not 1. You can...
  7. J

    Use variable as field name in IIf expression

    You can use a loop to loop through the sequentially named controls (S1 through S56) and count the number of checkbox controls that are checked. You would increment a counter for each checked checkbox control. When you are done looping, you would assign the value of the counter to the textbox...
  8. J

    Please help with Form & possible dlookup

    I would probably recommend an unbound form; as such when you have identified an available locker, you will need to enter the studentID in your text box control and then run an append query to take the values from the 3 combo boxes and the studentID from the textbox control to append a new record...
  9. J

    Use variable as field name in IIf expression

    No, you cannot do that. S1 is the name of a control, you need to do your comparison to the value in the control. Can you explain more about the bigger picture? Are you trying to loop through a series of yes/no controls on your form and you don't want to write a line of code for each control?
  10. J

    Use variable as field name in IIf expression

    You can use this: or this subject_checked = IIf(subj=TRUE, 1, 0) or this subject_checked = IIf(subj=-1, 1, 0) I believe that the following will also work provided that subj is defined as a boolean data type. You would not need any delimiters around the variable. subject_checked =...
  11. J

    Use variable as field name in IIf expression

    For a yes/no field or a boolean variable, -1 or TRUE=checked, typically zero or FALSE is used for unchecked. The IIF() function returns a value based on whether the condition is true or false. Is that what you are really after? Or, perhaps you need the IF..THEN...ELSE...END structure to do...
  12. J

    Please help with Form & possible dlookup

    I'm not sure I understand what you mean by the form doesn't reflect this. Are you saying that when you enter the studentID for a locker that is not assigned, the combo boxes are not correspondingly updated with that student? Is the form you are using bound to a table/query or is it unbound...
  13. J

    Use variable as field name in IIf expression

    You need to define a variable in code using the Dim statement DIM subj as long (sets subj as a long integer number datatype; there are other types as well depending on your needs) Now if you want to assign the result of the IIF() to subj, the statment would look like the following. If your...
  14. J

    New to Forum - Need some help pls

    Glad to hear that you got to a solution.
  15. J

    New to Forum - Need some help pls

    You're welcome. Just to make sure, did the query scheme I proposed give you what you were after?
  16. J

    New to Forum - Need some help pls

    Sorry that I misunderstood. You could use a query to get the distinct combinations of employee and cost center and then create a second query based on that first one to do the counting query name: qryTheDistinctValues SELECT DISTINCT [Data-Billing].[Employee Number]...
  17. J

    Help in Database Design

    Please post back with any questions on the design.
  18. J

    Find related records in same table

    You will need an append query. What is in the field SubQstnID if the question does not have any related subquestions? I assume that the SubQstnID field will have an A in it whether or not the question has subquestions or not. Start by creating 2 simple SELECT queries. The first one gets all...
  19. J

    Find related records in same table

    Add the tblQuestions a second time in the relationship window (Access automatically adds a digit to the table name but it is still the same table). As to the joins, you would join tblQuestions.QstnID to tblRelatedQuestions.fkMQuesID. You would join the tblQuestions_1.QstnID to...
  20. J

    Filter recordset

    You need to set db as the currentdb and I was basically trying to say to filter the initial recordset so you do not need the second at all: Dim db As DAO.Database Dim rst As DAO.Recordset Set db as CurrentDB Set rst = db.OpenRecordset(""SELECT Archive.num_article, Archive.Division FROM Archive...
Back
Top Bottom