So trying to fix one error, I have discovered/created another. I was advised to start a new thread and attach the full code I'm 'working with' ('ineffectually clubbing at' might be a better term to describe where I'm at right now!).
My goal with this code is to allow me to search my simple database (two tables linked by an autonumbered ID column). I have adapted code from the internet, using help from here and my very rudimentary VBA knowledge (mostly from Excel macros and logic, rather than Access know how).
Here's the VBA bits:
And here's the query: - SELECT FileInformation.ConcessionNo AS ConcessionNo
-
, FileInformation.Category AS Category
-
, FileInformation.Project AS Project
-
, FileInformation.DateCreated AS DateCreated
-
, FileInformation.PartNo AS PartNo
-
, FileInformation.Description AS Description
-
, FileInformation.DocumentNo AS DocumentNo
-
, FileInformation.ReferenceNo AS ReferenceNo
-
, Files.LinkPath AS Path
-
-
FROM FileInformation, Files
-
-
WHERE (((FileInformation.ID)=[Files].[FileID]));
-
Any help would be greatly appreciated! :)
[z{Link to backstory: http://bytes.com/topic/access/answer...ismatch-errors]
Hi
You could try putting an = sign in ie - [DateCreated] = #21/08/1991#
??
MTB
11 2664 zmbd 5,501
Expert Mod 4TB
Before we start, please ensure that you have a backup copy of the project.
Line 24 of the posted code block post #1 please insert a STOP command.
Save, close, reopen the form
Setup the form with the entries a user would normally made and click on the command button.
The code should go into debug mode and the VBA editor window open with the stop code highlighted (usually in yellow).
Using the {[F8]} key step thru your code - slowly. Please report back what line the error actually occurs.
I didn't have much of a chance to look at the Code, but what typically causes this Error is that the User attempts to access the Sub-Form itself as opposed to the actual Sub-Form Control. The Syntax would be: -
With Me![<Name of Sub-Form Control>]
-
.Form.RecordSource = "Table, Query, SQL Statement"
-
.Requery
-
End With
zmbd 5,501
Expert Mod 4TB
I'm suspecting that the fail will be on either line 32 or 35 for the reason given by ADEzii in that both make reference to the subform.
This is why I wanted the step thru as I'm not sure which of the two will fail.
Ok, so I followed zmbd's instructions in the first reply and I got a DIFFERENT error >.<
Run-time error '3075':
Syntax error (missing operator)in query expression '[DateCreated] #21/08/1991#'
And it failed on line 32 of the first lot of code in my original post - where you predicted! Just odd (to me) that it's a different error today! :/
Thanks :)
zmbd 5,501
Expert Mod 4TB
In the build function starting on line #46
The code starting on line #70 is as follows - ' Check for Date Created
-
If Me.txtDateCreated > "" Then
-
varWhere = varWhere & "[DateCreated] #" & Format(Me.txtDateCreated, "DD/MM/YYYY") & "# AND "
-
End If
The - Format(Me.txtDateCreated, "DD/MM/YYYY")
Is wrong.
It needs to be - Format(Me.txtDateCreated, "MM/DD/YYYY")
as per the link I provided in BackStory Post#10
Please make this change, do a compile and the restart and do the step thru as before.
*facepalm* I thought I'd changed that, must have forgotten to click save after or something >.<
And it's still having the same error I reported in my last post
Cheers
zmbd 5,501
Expert Mod 4TB
same error yes... however, when you stepped thru the code, which line did the error occure on?
It stopped on the same line as before, line 32.
Hi
You could try putting an = sign in ie - [DateCreated] = #21/08/1991#
??
MTB
Thanks, that's cured it! Knew it would be something simple and probably obvious if you have the experience!
Cheers :)
zmbd 5,501
Expert Mod 4TB
poooh, I missed when I was looking at the date format ( #6) - colour me a tad embarrassed... just proves that the more eyes on task will often find the solution!
(also I was expecting the reference to the subform issue)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Magnus Andersson |
last post by:
I really need some help with a Visual Basic problem. I am using Visual
Basic .NET and want find some text with a certain style in an MS
Office document. I have written something like:
Dim oFind...
|
by: Arnold |
last post by:
Hey there,
I just put the following code:
DoCmd.GoToRecord , , acLast
in the On Open event of my form, which has 2 subforms. The following
error message appears when the form now opens:
...
|
by: John Hunter |
last post by:
I've recently had a nasty problem with the "Invalid reference to the
property Form" error in subforms - nasty because it doesn't seem to
consistently happen to all forms which contain the same...
|
by: Jordan Fee |
last post by:
I'd like to perform some conditional formatting in the OnFormat Event of my
Parent Report. This works fine, until my subreports are blank, then the
invalid references start happening. I understand...
|
by: Giovanni Bassi |
last post by:
Hello All,
I have encountered a problem.
I am using visual inheritance and my base form adds an event handler on Form
Load using the AddHandler Keyword.
The problem is that if the Event...
|
by: Bill Coan |
last post by:
NOTE: This was posted earlier to vsnet.vstools.office under a different
subject line but received no response.
I'm having a problem automating Word's Find object from a .NET application,
using...
|
by: CQ |
last post by:
Hi everyone,
I get the following error when compiling my code:
error: invalid initialization of non-const reference of type 'Vertex&'
from a temporary of type 'int'
The implementation of...
|
by: Dave |
last post by:
This is the first time I'm trying this in an ADP. I'm using Access
2003 and trying to change the Apptitle Property using the below:
With Application.CurrentProject
.Properties("AppTitle").Value...
|
by: MyWaterloo |
last post by:
I am trying to open my purchase orders form and go to the last record. In the on open command I do: DoCmd.GoToRecord , , acLast Seems straight forward enough...but I keep getting this message...
|
by: Abest |
last post by:
I am trying to get my form to autofill the values from the last record to the new record. In the form properites on the BeforeInsert, I used the following module
I have been away from VB for...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |