Search results

  1. A

    Update Query for a specific character

    The following version of the function is more robust in that you can replace any length of string with any string. The other version didn't work properly where the string to be replaced was longer than 1 and repeated side by side. Have been meaning to update it for ages but kept forgetting...
  2. A

    Update Query for a specific character

    The following function will do the job. Since it will just replace one string at a time you will need to run it twice, one for "(" and once for ")". Public Function ReplaceWithChar(str As String, strFind As String, strNew As String) Dim intLen As Integer, i As Integer, intPos As Integer...
  3. A

    Add 3 years to date

    If the field you want to add 3 years to is BeginDate then the following should work DateAdd("yyyy",+3, [BeginDate]) or DateSerial(year([BeginDate])+3,month([BeginDate]),day([BeginDate]))
  4. A

    Multiple/Duplicate Records in a ComboBox

    Build a group query behind the combo to select the details required, it should group similar details together so you'll only get one line for each project.
  5. A

    help

    One solution is to export the report as a PDF file (Acrobat Reader) which will keep the format. There are various addins/tools available to do this. One that I find useful is Win2PDF, search the net and you can get a trial version to try out.
  6. A

    date in text box?

    Try the DMax and DMin functions to get the latest and earliest date.
  7. A

    data conversion: string to number

    A number cannot have leading zeros, by using CLng you are effectively removing the leading zeros. Since the Number field is actually text you are as well off removing the CLng line and running without it. With this "0001 001" would become "0001001" and will be saved as text. Do Until RS.EOF...
  8. A

    Drop Preceeding zeros on Report

    Just set the control source of the age field to CInt([YourAgeField])
  9. A

    start and end dates for week

    The following functions get the last day of a week and the first day of a week. You just need to send through the date and first week day value, the first week day value defaults to whatever is set in your system settings, usually Sunday or Monday. To get start and end for 4 weeks in advance...
  10. A

    NoData code

    If the problem is that there is no data at all in the report then you could use the NoData event of the report to stop it opening, check help file for NoData. If it's just that particular records don't have data which is causing the problem then you can use the IsError function to check for the...
  11. A

    code for cutting strings

    The following will break a string into strings of n characters long. I have left it to yourself to write the code to populate your table since you say you have this worked out. If the original string is not fully divisible into strings of n characters then the last string will be of less than...
  12. A

    Dates

    How you set the values of the InvDate and RecCashByDate depends on how your form is set up. If your form is bound to a table then you need to use code behind the AfterUpdate event on the JobDate to set them, see below. If the form is unbound then you can use the following statements to set the...
  13. A

    Resetting Default Value

    Thanks for the reply Pat. It's not so much that I don't want to use a table, more I was trying to find out if you could programatically change the default values. If the actual default values could be reset when the user changes the values in the fields then there would be no maintenance...
  14. A

    Dates

    The following should do the job. Invdate: DateSerial(Year([Jobdate]), Month([Jobdate])+1, 1) Creates a date of 1st of the month following date entered. Reccashbydate: DateSerial(Year([Jobdate]), Month([Jobdate])+2, 1) Creates a date of first of month, 2 months after date entered. Need to set...
  15. A

    Resetting Default Value

    The defaults are production targets that change each quarter, there is no formula involved in their calculation, the management determine them for each quarter. Below is an example of the sort of figures involved for 2001 and 2002. Eg SPL Target Qtr1/2001 4550 Qtr2/2001 4900 Qtr3/2001...
  16. A

    Resetting Default Value

    Just wondering if the following is possible and if so how to do it. I have a form that has multiple fields that have default values. These values will be fixed for a quarter and then will change. Currently the users contact me to change the defaults every quarter in the design view of the...
  17. A

    date range problem

    Within your query set the date field to the expression below format([YourDateField],"mm/dd/yyyy") and then put your criteria below this of Between[Enter a starting date:] And [Enter an ending date: ]
  18. A

    Dlookup help

    Your current DLookup is just getting the same record over and over again. Try the following: =DLookUp("[Significance]","TableSignificance","[SignificanceID]=" & [Significance])
  19. A

    Zeros Dropped

    If the field is dropping zeros then the field is formatted as a number. You have two choices in fixing the display to show 8 digits with leading zeros where required 1) Leave the field as a number but set the format of the field to '00000000'. This will mean the field will now display as 8...
  20. A

    problem with data in query :(

    Create a select query with both tables. Link on Company ID and select the fields you want to display. Set your order and the query should return all contacts with details of the company they work for. If this does not work then it sounds like there are contacts who are not assigned to a company.
Back
Top Bottom