Search results

  1. S

    Date Formatting - Again!

    gray, to answer your other question: Dim DateAdd as Date ' This will store the current date and time in a variable called DateAdd ' VBA stores the date as mm/dd/yyyy, but since you have reversed the ' day and month, these *may* now be the wrong way round, depending on ' whether the reversed...
  2. S

    Date Formatting - Again!

    Hi, Don't worry when you write the SQL code how it will appear in the table. Rainlover is right - the date/time is really just a number relating to the number of days since 1/1/1900. You have to specify the date/time in the query so carefully to ensure that it is stored correctly. But despite...
  3. S

    ranking results query

    As Paul rightly says you need to include the name of the person in the subquery like this. I have limited the query to only displaying the top 4 scores by specifying that the calculated rank < 5. SELECT s.Person, s.Score, (SELECT COUNT(*) FROM [tblScores] WHERE (((Score) <= s.Score) AND...
  4. S

    could this be done with MsAccess

    Hi Alan, As it sounds like you are quite new to database development I thought I could give you a few pointers in the right direction - although you should know that I am at the level of enthusiastic amateur! Sorry if any of this is obvious. As you are going to be using the database on a...
  5. S

    Date Formatting - Again!

    It's even more of a minefield than you might at first think too. If you enter the date 06/04/2012 as dd/mm/yyyy into VBA then it will reverse the day and month to give 04/06/2012. However if you enter the date 13/12/2012 it cannot correspond to a 13th month, so VBA will assume you mean 13th...
  6. S

    Date Formatting - Again!

    Hi, I am a fellow UK citizen with endless headaches using dates in VBA. VBA will assume that a date in the format ## / ## / #### is mm/dd/yyyy regardless of the regional settings in windows. Even if you supply the date using the # symbol it will still reverse the order of the day and month...
  7. S

    Question Due date - Working Days

    OK, the code below will take the holiday dates into account. To call the function from your query use this: DueDate: CalculateDueDate(Format([StartDate],"mm/dd/yyyy"), [NumberOfDays]) The format statement is needed, because VBA requires date in the American format - mm/dd/yyyy. You will need...
  8. S

    Question Due date - Working Days

    Have a look at the help file for the WorkDays function in excel - this is exactly what it does - adds a given number of days to a given date. You can use functions written using VBA exactly the same as you use the built-in query functions - the only disadvantage is that it can be a bit slower...
  9. S

    Gathering entries that spread over dates ranges

    If I understand your question correctly you are looking to determine the number of days that two date ranges overlap by. I suggest you search the internet for something like "number days two date ranges intersect"
  10. S

    I need help please! Run-time error '3709':

    I'm not an expert, but I don't think you can open a recordset like that from Excel. I think you will need to do something like: dim strSQL as String strSQL = SELECT * [Technican_Name] FROM [Service Board] WHERE [Technician_Name].Text = ' & Call Holding 1 & '" set rs =...
  11. S

    Question Due date - Working Days

    Hi, There is an Excel function that will do this for you. You can create an Access VBA function using it like this: Firstly create a new VBA module. Next you will need to add a reference to Excel. Go to the VBA editor (press Alt + F11) and select Tools > References from the menu. Scroll down...
  12. S

    could this be done with MsAccess

    Hi Alan, Firstly I think the URL in your post is incorrect - I think you mean expressbanners.ltd.uk not expressbanners.co.uk! Having found it, the pdf explains very well what you are trying to achieve. I have an additional question - on your form or report is it important to show all jobs at...
  13. S

    Automatic Standardisation Within a Table

    Hi, Firstly you will need to create a form for data entry Lets say you create a form with two textboxes called "txtValue" and "txtStandardisedValue" The user enters data into the textbox "txtValue". Use the AfterUpdate event for the textbox and enter something like the following: Private...
  14. S

    adding a recurring number field to a table

    Lets say the Autonumber primary key in your table is called ID. To create a query with the recurring number you want you can generate a new field based on the autonumber like this: RecurringNumber: (([ID]-1) Mod 50) + 1 You can either sort by this field in the query, or add it to a new field...
  15. S

    Is this doable in MS Access Query?

    Presumably the UnpaidBalanceID is an Autonumber, and will therefore increase by default with time. That might just be the solution to the problem, because you can limit the number of records that the DMax statement looks at using the UnpaidBalanceID. How about this? UPDATE tblTest SET...
  16. S

    Is this doable in MS Access Query?

    in your example the unpaid balance increases with date. Is this always the case or does it vary?
  17. S

    Counting time and show the subtoal in the Form??

    Does the form display all employees at once, or a single employee at a time?
  18. S

    Problems with a Tab Control

    Can I suggest a slightly different strategy - it might be confusing having three forms that all display the same data. Instead I would have a single form, but three combo-boxes for the user to select the data they wish to view. Each combo box would display the options for a given field in the...
  19. S

    Subform instead of listbox Part 2

    It sounds like the main form is working fine. Create a new form, and base it on "studentclasses" table. You can lay this out however you want, but to display all records at once you will either need to set the view to "Datasheet" or "Continuous Forms". You can then drag the new subform from...
  20. S

    Help! Form Field validation

    Sorry if I have misunderstood, but from your description it sounds like the user will enter both a device type, and a barcode, and you want to check if they match. In your code you can get the first two barcode digits from the Device_Type table using something like this (where "FirstTwoDigits"...
Back
Top Bottom