Search results

  1. K

    No current record error

    Before the code you want to run that uses the record set you just opened you need an if statement that checks to make sure that it has records. To do that use the recordcount property With rs If .RecordCount <> 0 Then .MoveLast .MoveFirst code to run...
  2. K

    time format of txt box

    I don't think Access recognizes nanoseconds, which would cause a problem because it would not recognize the text as a time format which would be why "hh:mm" doesn't work. On this form are you just displaying the time or do you need to be able to enter and edit it as well?
  3. K

    time format of txt box

    I have had a similar problem before on reports and ended up having to format the field in the reports record source so was feed to the textbox in the correct format.
  4. K

    Expression Builder Issues

    IIf([criteria_id] Like "P*",1,0) This would return a 1 for a record where the criteria_id started with P and 0 if it didn't. If you then summed this you would get a count for all the records. The * after the P means it will look for something that starts with but P doesn't matter what is...
  5. K

    Figure out End of year age based on a date

    Sorry your absolutely right. I miss read the question and thought he was looking for the age at the DOS date which is what my code does and not the end of year of for the DOS.
  6. K

    Figure out End of year age based on a date

    Problem with using Datediff is it will only compare the year. So if you had a 12/31/2000 and the 01/01/2001 it would see the the year difference as 1. The code below should give you their age at the DOS date Format([DOS] + 1 - [Birth Date], "yy") Take away the birth date from the DOS and...
  7. K

    Subform query error

    You probably have checked but is default view set as single form in properties
  8. K

    Return Date of Previous Day of Week

    Hi Paul Thanks for pointing that out and giving an explanation. Gone back to look at where I have used the code and saw that I actually use a if statement to check if its a Sunday and if it take away 6 days. Kind of places I have used it is in the default value for date boxes used to filter...
  9. K

    Preventing arrowing back in simple Access 2010 For

    Open the properties for the form On the Format tab set the Navigation Buttons to No which will get rid of the buttons at the bottom of the form that let you move between the records. On the Other tab set Cycle to Current Record. It will just cycle round the fields on the form instead of moving...
  10. K

    Return Date of Previous Day of Week

    Date()-Weekday(Date())+2 date() gives todays date, Weekday(date()) gives the value of the weekday which you take away from the date and 2 is the value for Monday so by adding it you get the date for the last Monday. I would be interested in seeing how other people would do it and if there is a...
  11. K

    form filter

    You could have a query for each form that is uses your current query as its bases and put the criteria in the new query. By using the current query as the base for the new queries they will stay in sync with each other if you make any changes in the future. Or I suppose you could set the filter...
  12. K

    Please help noob here

    What version of access are you using and is it the same version on all the computers?
  13. K

    collecting 2 peices of information from a combo box

    Are you selecting the part from a existing stored list of parts then. If it is information already stored in the database then it would be better to just store the ID field in the other table and use that link to the information when you need it rather then copying all the information across.
  14. K

    How to know emplty recordset

    Its normally a good idea to check the record count before you do anything with the record set to avoid errors. My self I do Set TRANS2 = db.OpenRecordset("SELECT * FROM TRANSACTION WHERE tcode = 't12345'", dbOpenDynaset) If TRANS2.RecordCount<> 0 then TRANS2.MoveFirst End If
  15. K

    Missing Users and Permissions in Database Tools Administer

    I forgot to say that when you add a user they will be added to the user group by default. You will need to add them to any other groups you want them to be part of and this done on the same screen and tab in the group membership section.
  16. K

    Missing Users and Permissions in Database Tools Administer

    In 2010 running a mdb you will find Manage USers & Permissions under file in the ribbon. Select User and Group accounts and a window will open where on the users tab you can add a new user. You will need to make sure you are logged in as a admin user to be able to add a new one. This is also...
  17. K

    Filter a ComboBox

    Something I have done before is use the combo book to order the selections in the next one. You end up with the most relevant selections at the top of the list but the list still contains everything so doesn't blank for the other records. In the second combo box dropdown list I show the field...
  18. K

    Tabcontrol form question

    If you are opening the form from a button on another form you can set the focus there, after the line that opens the form. DoCmd.OpenForm "FORM_NAME", , , stLinkCriteria forms!FORM_NAME!Tab.setfocus Advantage of doing it there is that you can open the form from different places and have a...
  19. K

    time exports to Excel as 00/01/1900

    You can format the column it goes into using vba I assume that the xxxxxxxxxxxxxxxxxxxxx is the path to where you are saving the spreadsheet. You run the code to do the formatting after the export. DoCmd.OpenQuery "qryRCADditionalDatesFilteredExport" DoCmd.TransferSpreadsheet acExport...
  20. K

    Modify Titles of Query Fields

    Is the Signed:SIGNEDYN meant to be alias for the field. If so you will need to put it in quotation marks so "Signed:SIGNEDYN":Iif([Library].[SIGNED],"Yes","No") It uses the : to distinguish between the alias and the field, 2 of them confuses it if you don't have the quotation marks
Top Bottom