Search results

  1. D

    Creating Report when a button is clicked with appropriate colour of each record.

    If you go the report design and select a suitable field such as your Target Date, use the conditional formatting (under the Format menu) to set the back colour or text colour. You can create an expression in the condition as criteria to set Red/Amber/Green David
  2. D

    Help with loop on recordset

    try making strData = "SELECT test.* FROM test" David
  3. D

    dB design approach RE: multiple disconnecting / reconnecting users to a WAN dB

    I can envisiage a methodology that would work here, essentially all users have their own databases and the synching process would consist of some vba to establish a connection using a DSNless connection string then looping through the table of records (marked with this userID) checking if the...
  4. D

    Login Session code don't run

    What you've posted here is a mixture Functions and Private Subs. You will experience trouble if you've pasted all this code into a module. Functions should be saved in Modules and can be called from anywhere within your project, but Private Subs can only be accessed from the associated object...
  5. D

    Update SQL/VBA with multiple where clause

    I suspect it's to do with your braketing within your WHERE clause where print = -1 and " & stDocCriteria try: where((( print) = -1) and " & stDocCriteria & ")" David
  6. D

    Update SQL/VBA with multiple where clause

    why not include the 'where print =-1' in your stDocCriteria David
  7. D

    How to output my VBA SQL query to a report

    are you wanting to use the returned values of the sql above in a report, if so just create a report without a record source, add all the required text boxes and set the report record source to your sql in the report open event BTW I don't think it's necessary to use vbcrlf in the sql, just...
  8. D

    DBA Code - Identify if 2 fields within a table have been populated

    ok, last question, what is txtCusDate, if this is a text box on a running form then try modifying your query and use the query to set the criteria. So in your query write "Waterside" in the criteria line under the Restaurant field and in the citeria line for MealDate field use the wizard to...
  9. D

    Create Email from MSAccess

    working with email templates works fine when the email body is to remain unchanged, but trying to edit the body text and insert variable values is probably more work than coding the complete body text in vba, where you can use variable's values. If there are only a couple of variables, you...
  10. D

    DBA Code - Identify if 2 fields within a table have been populated

    can you post a list of the relevant fields in the relevant tables David
  11. D

    DBA Code - Identify if 2 fields within a table have been populated

    I don't think you can use DCount like this, the first part looks ok If DCount("*", "TblDietPlan", "[MealDate] = " & Format(txtCusDate, "\#mm\/dd\/yyyy\#")) <> 0 but you can't now refer directly to TblRestaurant, you can only refer to a field in TblDietPlan, if TblDietPlan has a restaurant id...
  12. D

    Get latest record

    Is StockId the PK for tbl_StockItems, if so it won't be necessary to use Select TOP... because there should only be one record with that StockID anyway. Also is the table tbl_StockItems linked in the database i.e. you have direct access to the table, then you could use myVariable = Date -...
  13. D

    Excel vba copy worksheet from one workbook to another

    using statements like Set wkbDest = Workbooks("IGEN_QC.xls") doesn't make that workbook the active workbook, it just sets a value for the workbook object wkbDest, to make that workbook active you need wkbDest.Activate once you done that you can refer to that workbook to execute a command. With...
  14. D

    Update query headache

    From what I can see in your attachment, there are 3 tables: Accrual, Agents, SickVacUse Am I correct in assuming SickVacUse.Event_ID links to Accrual.Cycle_No, if not I don't see how you can calculate vac_earned field to equal [agents].[vac_accrual] x sum( [accrual].[earned] ) because there's...
  15. D

    Question Conceptual Design and methodoligy

    I'm not sure Access is the right/best tool for your visual output, it could certainly manage data representing the timeslots taken by each schedule for each piece of equipment, but to turn that data into the desired visual output will be tedious as I see nothing better than creating a report...
  16. D

    code error

    try this, I notice you have some If's with no End If's, I think that will work only if you follow the Then with a colon : Not sure you have the day incrementer in the right place, you may have to sense check the result when you get it to work, could try moving it to just before the 'Loop' if the...
  17. D

    Sequential numbering Dcount Dmax composite primary key

    yes that is even better ... nice solution David
  18. D

    Sequential numbering Dcount Dmax composite primary key

    wouldn't this work If DCount("[treatmentnr]", "Tbl_treatment", "[ID] = " & Me.ID & "" & "AND [tumornr] = " & Me.tumornr & "")> 0 Then Me.treatmentnr = DMax("[treatmentnr]", "Tbl_treatment", "[ID] = " & Me.ID & "" & "AND [tumornr] = " & Me.tumornr & "") + 1 Else Me.treatmentnr...
  19. D

    Generate multiple records in one table from single record in another table

    The first table that shows inventory position, how is this generated or is it simply a static lookup table where the values can be updated. From the values you have in your first table, I don't see how the second table corresponds to the first or am I misunderstanding it. Without seeing the way...
  20. D

    Three Fields Searched in One Query

    sorry bceo you're not understanding the first paragraph of my previous reply. The new staffID will hold the ID number from the old table TBLLicenseNumber because ID is the primary key of the staff table and that is all you need to link back to that table. Each new record would look like this...
Back
Top Bottom