The mismatch problem is that when you are trying to
put the / into the text you are executing, it is ending
the string with the first " which means Access then
sees a / out on its own i.e. not part of the string you
are trying to build.
You need to replace all of the " / "...
Looks like you are trying to open a table and not
a recordset, so change the line to the following:
Set rst = CurrentDb.OpenRecordset("select * from tblDepartment", dbOpenDynaset)
Regards...
Try DoCmd.SetWarnings = False before you run the queries.
Make sure you do a DoCmd.SetWarnings = True when finished.
Also, make sure you have a DoCmd.SetWarnings = True in
the error handler for the procedure you use it in (just
in case).
Regards...
I'm afraid I'm not going to be much help to you on this.
I'm not hugely familiar but tried to find some info
on it anyway. The only way I could find to refresh the
procedures collection is to use adox like so (which is not
how you want to do it):
Sub ProcedureRefresh()
Dim cat As New...
Firstly, there is no point refreshing until you have
created the query, so put the refresh in after the
'DoCmd.RunSQL SQLstr'.
I'll check out your code when I get to my home PC which
has Access 2k on it - Access 97 here (love those
corporate software standards).
Regards...
You could try turning off the screen echo when doing
the module creation like so:
Application.Echo False
DoCmd.Hourglass True
'
'Do module creation here
'
Application.Echo True
DoCmd.Hourglass False
Regards...
Alternatively, in Acc2k (I think) there is a function
called 'replace', and used like this:
replace("1 2 3 4 6", " ", "")
it may be what you are looking for if you want to do
it all in one function.
Regards...
Only way I am aware of checking this is to either run
the report and check for nodata as you are doing or run
the report's underlying query and then check for its
recordcount.
If you are going to do the second method, and you are
running a complicated query, then you will essentially be...
This is how I call a report and trap (and discard) the
no data error Access throws up:
DoCmd.OpenReport v_Report, v_Options
'Don't display error message twice (i.e. report already displays it)
If Err Then
vErrNo = Err.Number
vErrDesc = Err.Description
If vErrNo = 2501 Then...
Not 100% sure what you want, but if it is to display
the codes on individual lines in a textbox on a form
or report, then in your splitting code, add a vbCrLf
to the split line after each code is added to the
variable, e.g.:
vCodes = vCodes & lstrCode & vbCrLf
Reply if you still have...
Modify the code to include the following as an additional case in the select case statement:
Case "Macros"
If Application.CurrentProject.AllMacros.count = 0 Then
MsgBox "No " & pObjectType & " exist in the database"
Else
For i = 1 To...
I use the following function to populate a listbox on an
export form which allows the user to see tables, queries
or reports in a listbox according to their selection
(sent in as pObjectType).
Reply if you still have problems.
Regards...
==
Public Function ListObjects(pObjectType As String)...
Hi Steve,
Easiest way is to create a button and use the wizard that
pops up to call the report.
Create a button on the form and the wizard will pop up.
Select Report operations and then select either "print
report" or "preview report". Then select the report to...
Have you checked your formname and your combobox name?
You are using [Forms]![SelectContractor]![Engineer]. Is
your form named SelectContractor? Is there a combobox named
Engineer on that form?
Once, you have this sorted, create a new report and base the
report on the query you have created. If...
If I am getting the whole picture, you just want to have
the query criteria picked up from the form at the time
of running the report?
If so, say the form is called frmYourForm and the
form field (which I assume is a listbox) is
lbxYourContractor, and the field in the query (say...
My experience is in Access, VB and R:Base - also
SQL Server, MySQL and some PostGres. I am looking to
evaluate PowerBuilder and want to get a real feel
for the product by doing a fairly decent application
that I have already developed in one of the others
above (as you do to get used to a new...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.