Search results

  1. A

    Iif Statement in a report

    As a better method I found it easier to store the company address in the Users table and then look that up based on the PreparedBy value. What this means is that there is now no longer any need to perform an IF or case statement on the resulting value. The resulting value of the code ChrisO...
  2. A

    'Go To Record' button

    The form does not actually take all the records that exist in the database. It only takes ones with a 'status' of 'Awaiting Agreement'. It is a system which deals with quotes sent out to customers, once the quote is accepted ('Status' is updated to 'Confirmed') then they no longer appear on the...
  3. A

    'Go To Record' button

    Using a combo box does the trick, but for representation purposes it would be nice to have a command button with a pop up message asking for an input. Validation would be done after an incorrect value was entered, rather than restricting it all together
  4. A

    Iif Statement in a report

    This is what the code looks like for the whole thing now: This does the trick perfectly. I really cant thank you enough for your help
  5. A

    Iif Statement in a report

    The error was being caused because there was no control location called 'txtPreparedBy' it was just 'PreparedBy' Complete novice mistake on my part, the text box named 'txtLocation' now displays 'London' for those users based in London and 'Slough' for those users based in Slough. What I have...
  6. A

    'Go To Record' button

    I have a form at the moment that has next record and previous record buttons but I want to add a 'Go To Record' button. When this button is clicked it should open an input display which says 'Enter Quote Number' (Quote Number is a field, it is not the same as record number). The when an order...
  7. A

    Iif Statement in a report

    I added the code you supplied to the report and when I tried to open it I got the following compile error: 'Method ot data member not found'
  8. A

    Sorting Problems

    Thanks for that code, could you please describe it in a bit of detail and explain how it would fit in with the code I provided? Thanks
  9. A

    Iif Statement in a report

    Thanks for the offer to take a look, I wish it was as easy as that. Unfortunatly due to confidenciality issues it would be a breach of my contact if I shared the database with anyone The box on the form where the 'PreparedBy' value is a combo box with row source type: Table/Query and the row...
  10. A

    Iif Statement in a report

    As far as I can tell the report takes values from the Order table as well as values from subtables within the Order table. I am not completely sure how Order.PreparedBy gets in there. Sorry for my lack of understanding of exactly what is going on. I was not the person who created the database...
  11. A

    Iif Statement in a report

    Yes, 'PreparedBy' is actually a field in another table called 'Order'. This value is defined by a drop down menu in a form which lets you choose from the list of usernames recorded in the 'Users' table. The report takes the value of 'Order.PreparedBy'
  12. A

    Iif Statement in a report

    The report is not created from a query, it just takes various fields from different tables. Is this what you mean?
  13. A

    Iif Statement in a report

    The 'PreparedBy' value appears as an accepted value in the 'Control source' value of a text box (This means it is in the report's underlying query?) How do I go about linking in the users table based on the 'PreparedBy' value?
  14. A

    Iif Statement in a report

    Yeah, I think that would be easier. Say my updated 'User' table has the following fields: Username, Location, Addres Line 1, Address Line 2, Address Line 3, Postcode, Tel, Fax (A new form would probably be created for filling all this in) The question: How can I get Access to look at the...
  15. A

    Iif Statement in a report

    The 'PreparedBy' value is already displayed on the report in a text box. What I want to do is have another text box which says a bit more than either 'Slough' or 'London'. I want something that looks at the 'PreparedBy' value, looks this up the table to get the 'Location' value (as your code...
  16. A

    Iif Statement in a report

    Where does this resulting value appear? In terms of using it in an iff statement would it be something like: Iif Me.textlocation = 'Slough' then do Slough address else do London address? Or a similar concept but in a case statement (as Mr B suggested)
  17. A

    Sorting Problems

    I am having difficulty getting my sort function to work on a report. Below is the code being used in the report: Private Sub Report_Open(Cancel As Integer) mainsql = "SELECT Quote_Number, Company_Name, Date, Contact_Name, Contact_Number, PreparedBy FROM Quotations " addSQL = "" If Forms![Main...
  18. A

    Iif Statement in a report

    ChrisO, where would that code fit in? What does it do? and whats the output value?
  19. A

    Iif Statement in a report

    A case statement would definitely make it easier to read and would allow for easier expansion, but the statement would be much longer since the address would have to e typed out for each of the 5 cases (1 case per user).
  20. A

    Iif Statement in a report

    Hey, I am having some trouble with an Iif statement. My current one works but it is massive, and impracticle. Here is the problem: The Iif statement is supposed to generate an address depending on which department creates the invoice (one department is in Slough, and the other is in London...
Back
Top Bottom