473,499 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Print form view information into a report and then extract to word in one process

18 New Member
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.....Thanks 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
Attached Files
File Type: doc Private Sub cmdFINISH.doc (27.5 KB, 250 views)
Aug 14 '12 #1
4 1687
zmbd
5,501 Recognized Expert Moderator Expert
Do you have the following set at the top of your module:
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. 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
Aug 14 '12 #2
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):
Expand|Select|Wrap|Line Numbers
  1. FileName = ID & " " + CustomerName & " " + Registration & " - " & ReportName & DocType
would evaluate to something like (assuming there are no null values):
"ID CustomerName Registration - ReportNameDocType"
if there are nulls then you get: " - " =
"(null)(space)(null)(space)(null)(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
Aug 14 '12 #3
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.
Aug 14 '12 #4
Nicholas Davenport
18 New Member
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
Aug 15 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4281
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
2
3141
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...
3
8394
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...
3
1838
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...
5
3071
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....
0
1311
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...
3
3956
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...
0
1791
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...
6
9376
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...
11
1837
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...
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7385
tracyyun
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...
0
5467
agi2029
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,...
1
4917
isladogs
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...
0
4597
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...
0
3096
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...
0
1425
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 ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.