Hi, I hope someone can help!
I have a finance form where the information is manually completed by agents, I would like it so that when the agents click finish to add a new record, the details that have just been completed will automatically print off and while at the same time the information is also stored for our records as a back up on our server. I have seen this process working, so I have tried to replicate it myself but I seem to be getting a mismatch type error and it's driving me insane. Would someone be able to check my code and help me with where I’m going wrong.....Thank s in advance for your time, it's appreciated
I have attached the code in a word document, The code I'm struggling with is highlighted in Bold....Thanks
4 1689 zmbd 5,501
Recognized Expert Moderator Expert
Do you have the following set at the top of your module: - Option Compare Database
-
Option Explicit
Have you done a compile from the debug menu?
Would you also post the actual string returned from "FileName ="? (if you're steping thru the code...you can press <ctrlG> and then type ?Filename)
and finally...
place a stop command on a line below the "DIM" statments and [F8] thru your code until you get the error. It would be helpfull to know exactly which line is causing the error.
-z
zmbd 5,501
Recognized Expert Moderator Expert
For your sanity...
When nameing directories (folders), files, forms, tables, fields, queries, or what have you; it is better not to use any spaces, specical charaters, etc... instead, it is a best practice to use only the underscore and alphanumeric charactors in these names.
For example your code (using just what you have): - FileName = ID & " " + CustomerName & " " + Registration & " - " & ReportName & DocType
would evaluate to something like (assuming there are no null values):
"ID CustomerName Registration - ReportNameDocTy pe"
if there are nulls then you get: " - " =
"(null)(space)( null)(space)(nu ll)(space)(-)(null)(null)"
or if the "docType" is set " - .DOC"
Now I know that the current operating systems will allow this; however, when you go to search for the file later... good luck.
You'll find that queries on tables and fields that include spaces will also be much more difficult to write...
-z
twinnyfo 3,653
Recognized Expert Moderator Specialist
Nick,
Just reviewing your FINISH_Click Sub, it does not look (on the surface) that your error is starting in the code. There might also be a data type mismatch in the underlying data of the report, whihc would cause the the error to trip at that point, as well.
In additioni to Z's advice, try running the report's underlying query by itself to see if it functions properly.
Thanks to both of you for your quick replies, I've been out of the office today, but will have a look over your suggestions tomorrow. I'll double check the Option Compare Database & Option Explicit and run through the d-bug to obtain the error line, and I'm quite confident the report pulls all the correct information/data through into the correct fields I've selected within the report, but I'll double check, again, thanks very much for your time, it's appreciated
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: David Allison |
last post by:
cmdButton to Print 3 copies of record in Form view ?
cmdButton will print 1 but I need 3 copies of the one Form record.
--
Dave Allison
|
by: Simon Pleasants |
last post by:
Am something of a newbie at this, so please bear with any stupid
questions.
I have created a database to track shipments that we import. The
information is stored in a table and I have created a form which
displays the information from the table. The end users have access to
the form only - this is deliberate.
I have created some...
|
by: John Baker |
last post by:
Hi:
I have a slight problem. I have a form that I designed without a header, and I
subsequently decided a header was required.
In design I went to View/Page header footer, and it appeared nice as you please. I then
put in a heading and clicked on Form View, and the header vanished. It will appear in
print preview, but not in Form view...
|
by: Simone |
last post by:
Hi,
I'm a DB newbie and I've been having issues trying to print the record
I am viewing in a form to a report. I have looked in groups all over
and they all say to try basically the same thing but I can't get it to
work.
This is the latest code I've tried:
Private Sub NewRepairPrintPreview_Click()
|
by: feck |
last post by:
Hi,
Is there any code/routine to export a report as a word
document retaining the formatting. I have a requirment to produce
some fairly detailed statisitical reports for transmission by e-mail.
The reports require tweaking on a regular basis so I do not really
want to base a standard document on query data, but would prefer to
redesign the...
| |
by: J M |
last post by:
I have Windows2000 Application Event Log file in CSV format with all
kinds of entries However I need to process following types of records
for print logs and generate report:
9/19/2003,8:15:57 AM, Print, Information, None, 10, NT
AUTHORITY\SYSTEM, NTBOX112, Document 111, TestFile.doc owned by
MoJo(192.168.1.123) was printed on PRINTER1 via...
|
by: forest demon |
last post by:
for example, let's say I do something like,
System.Diagnostics.Process.Start("notepad.exe","sample.txt");
if the user does a SaveAs (in notepad), how can i capture the path that
the user selects?
thanks...
|
by: robwahl |
last post by:
Hi,
I have a members only area of a site (using ASP and MS Access) where I need users to be able to either view or download reports (PDF or MS Word doc - doesn't matter which). I want to store the reports in an OLE object field in the MS Access database. Using ASP, I can get the report to dump its contents in binary into an html table in the...
|
by: Dave |
last post by:
On my form I have combo boxes. These combo boxes, after updating
them, populate respective listboxes that are located below the combo
boxes on the same form. I am trying to use a "generate report" button
located on my form to print all of the list box values (that have been
updated via selection from combo boxes) from the form to the report....
|
by: radink |
last post by:
Hey All,
I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.
Thanks for any help!
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |