473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Record Update

I have a form that is tied to a table. On this form I have a button that
when clicked prints a report based on the information currently on the
form. The problem is that unless the user tabs past the last control and
moves to a new record, and then back to the record they just entered, the
report prints blank.

I know there is a way to update the record to the table without moving
forward and back on the form, but I can not remember what it is. I think it
is something about Rocord.Update but I can not find the exact command I am
looking for.

Anyone know how to do this?

Mike Charney
Nov 13 '05 #1
3 1603
Set the Dirty property of the form, like this:
Private Sub cmdPrint_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Michael Charney" <me@you.com> wrote in message
news:FE*******************@newssvr19.news.prodigy. com...
I have a form that is tied to a table. On this form I have a button that
when clicked prints a report based on the information currently on the
form. The problem is that unless the user tabs past the last control and
moves to a new record, and then back to the record they just entered, the
report prints blank.

I know there is a way to update the record to the table without moving
forward and back on the form, but I can not remember what it is. I think
it
is something about Rocord.Update but I can not find the exact command I am
looking for.

Anyone know how to do this?

Mike Charney

Nov 13 '05 #2
you could also just go to the button control and before it does the
report printing do:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Refresh

Nov 13 '05 #3
I apologize if this ends up as a double post

Try this, In your button event for printing put the following at the
begining

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Refresh
--------------
Billie
http://www.orpgs.com

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard C Buchanan | last post by:
I have a table as follows: - user_id (key) - user_email_address (text) - user_request_date (text) - user_sent_date (time/date) An automated macro...
5
by: Ilan Sebba | last post by:
When it comes to adding records in related tables, Access is really smart. But when I try to do the same using ADO, I am really stupid. Say I have two parent tables (eg Course, Student) and one...
4
by: James P. | last post by:
Hello there, I have a bound-form using Navigator so that the user can move back and forth to update record in the form. Every time a record was modified and the user clicks the Navigator to...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
7
by: todholt | last post by:
Hello, I am trying to bypass a form's automatic update, and instead call a stored procedure in sql server. I am using continuous forms. The problem I am having is with returning to the next...
3
by: Mihaly | last post by:
I want to update a record into a table in SQL Server 2000 database from C#. This table is used concurently for other users too, and I want to be sure that from the read of record to the update no...
3
by: PAUL | last post by:
Hello, I have 2 datasets I am trying to update. The parent table seems to update fine but when I go update the chiled table I get an error message that says I need a related record in the parent...
3
by: smugcool | last post by:
Hi, I have created a form in Visual basic 6.0 for adding/updating the change request made by various users. Well i am able to update the record through my code in access database. Can anyone...
0
by: emalcolm_FLA | last post by:
Hello and TIA for any help with this non profit Christmas assistance project. I have an applicant (app history) and child (child history) tables (4 total). I need to grab the next available (in...
0
by: Andy_Khosravi | last post by:
I'm having issues with updates being blocked due to some sort of record locking issue. The error does not occur consistently, so I've had a hard time nailing it down. It does happen enough to cause...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.