Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Picker 5

Status
Not open for further replies.

diggerbob

Technical User
May 20, 2004
24
US
I have used a date picker which uses a calendar on my form for sometime now and have no problem with it. I copied this to a new database that I am starting for someone else at work but every time I try to run it, I get the following error message: Run-Time Error '3075', Syntax error (missing operator) in query expression (Received Date Between #02/01/2008 And #02/18/2008#). I have even made another form from scratch and I still get the same error. The only thing I am doing differently is retreiving their table data from an import from excel.
 
Yes, I have got it working, and yes, I could kick myself... for not seeing that! I appreciate everyone's help on this.
Bob K
 
Do yourself a big favor and get rid of spaces in names for any object in Access and vba. You are begging for problems in Sql and code. Also avoid any special characters and reserved words. There are several "standard" naming conventions out there (google "Sql Naming Conventions" or "Access naming conventions"), pick one. Example

Code:
SELECT VendorName,PO_No, AccountCode, DateReceived, AES_ItemNo, PurchaseOrderDescription, CostCenter, ReceiveToID, QtyReceivedUOP, OriginalUnitCost, qtyReceivedUOP * OriginalUnitCost AS ReceivedTotal, ItemTotal, ItemTotal- ReceivedTotal AS AmountNotReceived
FROM tblAccrual;
versus yours
Code:
SELECT [Accrual Table].[Vendor Name], [Accrual Table].[PO No], [Accrual Table].[Account Code], [Accrual Table].[Date Received], [Accrual Table].[AES Item No], [Accrual Table].[Purchase Order Description], [Accrual Table].[Cost Center], [Accrual Table].[Receive To ID], [Accrual Table].[Qty Received (UOP)], [Accrual Table].[Original Unit Cost], [Accrual Table]![Qty Received (UOP)]*[Accrual Table]![Original Unit Cost] AS [Received Total], [Accrual Table].[Item Total], [Item Total]-[Received Total] AS [Amount Not Received]
FROM [Accrual Table];

 
And see the beauty & readability of sql if you have formatted like
Code:
SELECT
    VendorName
  , PO_No
  , AccountCode
  , DateReceived
  , AES_ItemNo
  , PurchaseOrderDescription
  , CostCenter
  , ReceiveToID
  , QtyReceivedUOP
  , OriginalUnitCost
  , qtyReceivedUOP * OriginalUnitCost AS ReceivedTotal
  , ItemTotal
  , ItemTotal- ReceivedTotal AS AmountNotReceived
FROM
   tblAccrual;
Code:
SELECT
    [Accrual Table].[Vendor Name]
  , [Accrual Table].[PO No]
  , [Accrual Table].[Account Code]
  , [Accrual Table].[Date Received]
  , [Accrual Table].[AES Item No]
  , [Accrual Table].[Purchase Order Description]
  , [Accrual Table].[Cost Center]
  , [Accrual Table].[Receive To ID]
  , [Accrual Table].[Qty Received (UOP)]
  , [Accrual Table].[Original Unit Cost]
  , [Accrual Table]![Qty Received (UOP)]*[Accrual Table]![Original Unit Cost] AS [Received Total]
  , [Accrual Table].[Item Total]
  , [Item Total]-[Received Total] AS [Amount Not Received]
FROM
   [Accrual Table];

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
MajP,
I understand that I should do that but that data will be imported into the table from an excel sheet. The person using this has to export the data from a database into an Excel worksheet. Then in turn, import it into Access. This will be done on a monthly basis. The names in the access table is exactly the way they come over from excel. Is there any way around that?
Thanks, BobK
 
Hi Bob,

I'm currently working on different methods of importing Excel data into tables. I'll let you know how I'm getting on. If your excel sheet doesn't differ each time in its format, then you can import the information by any sequence of the cells you wish. Programatically in VBA, using for next loops or by using a table to read the cell map indexes.



Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
Ian,

Thanks, and will be looking forward to hearing from you.

BobK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top