User Profile
Collapse
-
Thanks - it seems to be working now! -
I have amended my code to
but I now get 'can't find the field Year referred to in your expression' as an error message?...Code:Private Sub Form_Open(Cancel As Integer) Dim mydate As Date Dim myyear As Date mydate = Date myyear = Year(mydate) End Sub
Leave a comment:
-
Year Function
I need to extract the year part of a date and I have the following code to test
But it gives me a type mismatch when trying to find the Year of mydate. The same problem occurs with the Month function but the Day function works fine. I have used this code before without...Code:Private Sub Form_Open(Cancel As Integer) Dim mydate, myyear mydate = Date myyear = Year(mydate) End Sub
-
Date format in mail merge
I have an form in Access which runs a make-table query and then mail merges the contents to Word. One of the merged fields is a date - in Access the date appears in 'UK' format correctly but when merged to Word (with language set to UK) the date appears in 'American' format. Any ideas on how I can change this as my client is inisistent that the date appears in UK format?
Thanks -
-
Help with Dlookup syntax
I have a form based on tbl_Wedding_Pro ducts which contains a combo box cboPID which looks up product details in tbl_Products. I am trying to display the cost of the product (in text box txtUBP), held in tbl_Products, for the product selected in cboPID but it doesn't work. Can you sort my syntax out please?
txtUBP = DLookup("[Product Buying Cost]", "tbl_Produc ts", " [tbl_Products]![Product ID] ='" &... -
Referencing a form
Hi
I have a fairly complex database with many tables and forms (currently 38). Now when I create a new form it does not appear in the VBA Project Explorer window and when I try to reference it I get an error message saying it is an unknown form BUT it does exist in the access forms window. Do you know why this is happening and what I can do to overcome it as I need to utilise subforms and thus have to reference these forms.
... -
Calculated fields & time dependent data
Hi
I have a table called tbl_Products which stores details of available products including current price. I have a second table called tbl_chosen_prod ucts which stores the product id and quantity of the product required. I have written a query which allows the customer to choose their product, enter the quantity and calculates the total cost of the chosen product at the moment and that works fine BUT if I were to update the cost...
No activity results to display
Show More
Leave a comment: