473,806 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Event Code

I have a form called "EmpRpt". It has three fields. First field is
"chrUserID, " this is a combo box with a row source from another table. The
Second Field is "BeginDate. " The Third field is "EndDate."

I then have a command button. I want to put a code in this buttons on click
event. The code should open up a report called "EmpRpt."

The report will have the three fields just like the form. I want those three
fields to appear with the data the user entered in the form. I would also
like this report to open in print preview.

Can someone please help me with a code? Thank you!

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 9 '07
11 2081
ladybug via AccessMonster.c om wrote:
The dates do not come from a table. This is just a form which sets the
criteria that will be used when opening the report.
What help do you need?

Do you need help in creating a report?

Do you need help calling the report?

What do you want to print?

Allen's doing his best to help, I'm confused with your requirements.
You might want to tell us what you have, what you need, whether you are
using a table as the form's recordsource or if there is no recordsource.
>
Salad wrote:
>>>What two tables? There is no table for the dates they are just text fields.

You stated "First field is "chrUserID, " this is a combo box with a row
source from another table..."

So I figured 2 tables were in play. Sometimes combos can have multiple
columns and I figured the data in the combo might be used as well as the
other fields.

>>>>>I have a form called "EmpRpt". It has three fields. First field is
>"chrUserID ," this is a combo box with a row source from another table. The

[quoted text clipped - 28 lines]
>>>> If Me.Dirty then DoCmd.RunComman d acCmdSaveRecord
Docmd.OpenRepor t...

Aug 9 '07 #11
"ladybug via AccessMonster.c om" <u21071@uwewrot e in
news:76714e6932 a13@uwe:
The dates do not come from a table. This is just a form which
sets the criteria that will be used when opening the report.
Your statement that the form has three fields is what leads
people astray. Forms do NOT have fields. Tables have fields.
The process of binding a form to a table or query means that the
fields appear in the textboxes. Had you said there are three
textboxes on the form, you would have been clear.

As to your problem of the report not opening, your data talks of
chrUserID. is this really a text field, or an ID Number field?
If it's a text field, you need to modify the way you pass the
info to the form
strWhere = "[chrUserId] = " & Me.[chrUserID] will work for a
numeric field.
strWhere = "[chrUserId] = '" & Me.[chrUserID] & "'" is
required for a text type ID.
>
Salad wrote:
>>What two tables? There is no table for the dates they are
just text fields.

You stated "First field is "chrUserID, " this is a combo box
with a row source from another table..."

So I figured 2 tables were in play. Sometimes combos can have
multiple columns and I figured the data in the combo might be
used as well as the other fields.
>>>>>I have a form called "EmpRpt". It has three fields. First
>field is "chrUserID, " this is a combo box with a row source
>from another table. The
[quoted text clipped - 28 lines]
>>> If Me.Dirty then DoCmd.RunComman d acCmdSaveRecord
Docmd.OpenRepor t...


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 9 '07 #12

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

Similar topics

18
2892
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code that applies to all these events, but I need to have specific code execute when the form closes. The properties for this method are sender (the originator) and e (event arguments). I know how to get typeof (sender) to determine what form or...
6
1877
by: vbMark | last post by:
If I have a control, for example a CheckedListBox, how do I add and event to code, for example that a box has been checked by the user? Thanks
3
3646
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind page, 2) Breakpoint in the Page_Load, 3) debug the web page and click the submit button, 4) "step into" under debug several times, 5) The debugger does not stop at any of the statements in the click event handler. A breakpoint is needed in each...
7
390
by: Charles Law | last post by:
I may have asked this before, but what is the purpose of both these functions? Is there a time when one should be called over the other? Does one supersede the other, or do they both have their time and place? TIA Charles
13
3524
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the following issues still exist. The article shows how to find methods on a receiver that match the pattern OnXXXX given the sender. It loops through the sender events and tries to get methods from the receiver that match the pattern. For each one...
41
4338
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
9
2475
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the post event will always execuate after the system is completed... - I want to wrap this functionality in a framework, so I could possibly have 3 or 4 levels of inherited objects that need to have these pre / post events executed before and after the...
3
5545
by: geskerrett | last post by:
We have been asked to develop and application for a client that is a 'notification" system. We would like to use python, but are struggling to find the right starting point. Any suggestions, tips or sample code would be appreciated. Application outline; Machine A is running a "listener" application that is connected to a another device via the serial post and waits for events. We have not problem working with the serial port, or...
19
4763
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
4
237
by: tshad | last post by:
I am just getting started with events and had a couple of questions on why they do what they do. If you have a textbox and you want to handle an event you can just do: this.TextBox2.TextChanged += new EventHandler(TextBox2_TextChanged); and then have the function. void TextBox2_TextChanged(object sender, EventArgs e)
0
9719
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10373
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10111
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 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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9192
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5546
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.