My Assistant
![]() ![]() |
|
|
Feb 23 2012, 11:17 PM
Post
#1
|
|
|
New Member Posts: 11 |
Hi everyone..
I'm new with microsoft access, and i'm learning how to use it.. i've been given a task of creating a data entry system using the microsoft access 2007... I want to know how to create a button which have the function of creating new report when we click it.. And can we make it ask we to choose which field should be included in the report? |
|
|
|
Feb 24 2012, 12:11 AM
Post
#2
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
(IMG:style_emoticons/default/welcome2UA.gif) In the Ribbon, Create tab, Reports group, there's a button called Report Wizard. Will that work for you? Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Feb 24 2012, 01:12 AM
Post
#3
|
|
|
New Member Posts: 11 |
Hi, (IMG:style_emoticons/default/welcome2UA.gif) In the Ribbon, Create tab, Reports group, there's a button called Report Wizard. Will that work for you? Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) (IMG:style_emoticons/default/thanks.gif) for replying, but i dont think that will work.. what i'm trying to do is some kind of button in a form which can give some kind of that report wizard function... is it possible? (IMG:style_emoticons/default/iconfused.gif) i think it is the VBA code.. (IMG:style_emoticons/default/confused.gif) or not? can someone tell? |
|
|
|
Feb 24 2012, 11:45 AM
Post
#4
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
In that case, you can try using something like: DoCmd.RunCommand acCmdNewObjectReport Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Feb 24 2012, 07:34 PM
Post
#5
|
|
|
New Member Posts: 11 |
Hi, In that case, you can try using something like: DoCmd.RunCommand acCmdNewObjectReport Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) (IMG:http://a4.sphotos.ak.fbcdn.net/hphotos-ak-ash4/424077_324683570915765_100001223758343_957234_2061290262_n.jpg) lol, this is the result.. is it sometin wrong? i try this one, it work but the report is empty.. Dim rpt As Report Set rpt = CreateReport DoCmd.Restore (IMG:style_emoticons/default/iconfused.gif) |
|
|
|
Feb 24 2012, 11:17 PM
Post
#6
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
I'm just curious... how exactly did you try my suggestion? Can you give us the step by step? Can you post the actual code you used that caused the error? Thanks. |
|
|
|
Feb 25 2012, 02:28 AM
Post
#7
|
|
|
New Member Posts: 11 |
Hi, I'm just curious... how exactly did you try my suggestion? Can you give us the step by step? Can you post the actual code you used that caused the error? Thanks. thanks for keep helping me with this problem, (IMG:style_emoticons/default/big_grin.gif) ok, i created a button.. then in the visual basic for application, I attach the code which u gave me... Private Sub button_Click() DoCmd.RunCommand acCmdNewObjectReport End Sub is it wrong? (IMG:style_emoticons/default/iconfused.gif) |
|
|
|
Feb 25 2012, 04:34 PM
Post
#8
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
Thanks for the additional info. Just one more thing... Did you select [Event Procedure] in the Click event property for the button? If so, then maybe double-check that you have the Wizard installed or activated. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Feb 26 2012, 07:56 AM
Post
#9
|
|
|
New Member Posts: 11 |
Hi, Event Procedure? I don't really understand.. can explain a lil bit? (IMG:style_emoticons/default/confused.gif) Thanks for the additional info. Just one more thing... Did you select [Event Procedure] in the Click event property for the button? If so, then maybe double-check that you have the Wizard installed or activated. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Feb 26 2012, 11:01 AM
Post
#10
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
Event Procedure? I don't really understand.. can explain a lil bit? (IMG:style_emoticons/default/confused.gif) When I ask for the step-by-step, this is what I was expecting: 1. While in Form's Design View, added a Command Button 2. While the Command Button is selected, in the Properties Window, in the Event Tab, selected [Event Procedure] from the dropdown in the Click event 3. Clicked on the three dots (...) next to [Event Procedure] 4. In the Code Window, created the following: Private Sub ButtonName_Click() DoCmd.RunCommand acCmdNewObjectReport End Sub Hope that makes sense... |
|
|
|
Feb 26 2012, 07:17 PM
Post
#11
|
|
|
New Member Posts: 11 |
Hi, When I ask for the step-by-step, this is what I was expecting: 1. While in Form's Design View, added a Command Button 2. While the Command Button is selected, in the Properties Window, in the Event Tab, selected [Event Procedure] from the dropdown in the Click event 3. Clicked on the three dots (...) next to [Event Procedure] 4. In the Code Window, created the following: Private Sub ButtonName_Click() DoCmd.RunCommand acCmdNewObjectReport End Sub Hope that makes sense... Oh my gosh! It work!!!! the report wizard popup as I click the button.. (IMG:style_emoticons/default/thanks.gif) you are really helpful and reliable (IMG:style_emoticons/default/woohoo.gif) but, after I tried that, the report created as it should be, just sometin not right popup... (IMG:http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/428150_325881114129344_100001223758343_960851_2127669215_n.jpg) This post has been edited by ryan_apessimisl: Feb 26 2012, 07:45 PM |
|
|
|
Feb 26 2012, 10:46 PM
Post
#12
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
Glad to hear you're making progress. Try modifying the code to this: Private Sub ButtonName_Click() On Error GoTo errHandler DoCmd.RunCommand acCmdNewObjectReport errExit: Exit Sub errHandler: If err.Number<>2501 Then MsgBox err.Number & ": " & err.Description End If Resume errExit End Sub Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Feb 27 2012, 12:59 AM
Post
#13
|
|
|
New Member Posts: 11 |
Hi, Glad to hear you're making progress. Try modifying the code to this: Private Sub ButtonName_Click() On Error GoTo errHandler DoCmd.RunCommand acCmdNewObjectReport errExit: Exit Sub errHandler: If err.Number<>2501 Then MsgBox err.Number & ": " & err.Description End If Resume errExit End Sub Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) the error dialog problem solve.. (IMG:style_emoticons/default/thanks.gif) i just wondering what are these codes means.. (IMG:style_emoticons/default/pullhair.gif) |
|
|
|
Feb 27 2012, 01:07 AM
Post
#14
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
(IMG:style_emoticons/default/yw.gif) Glad to hear you got it to work. To learn more about Error Handling, take a look at this Wiki article: Error Handling Good luck with your project. |
|
|
|
Feb 27 2012, 01:13 AM
Post
#15
|
|
|
New Member Posts: 11 |
Hi, (IMG:style_emoticons/default/yw.gif) Glad to hear you got it to work. To learn more about Error Handling, take a look at this Wiki article: Error Handling Good luck with your project. heh.. really hard for a newbie to do the project with 0 knowledge about microsoft access.. to be honest, i dont understand any of these codes meaning.. (IMG:style_emoticons/default/pullhair.gif) |
|
|
|
Feb 27 2012, 12:13 PM
Post
#16
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
Perhaps you could start with Crystal's Learn VBA tutorial. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Feb 27 2012, 07:24 PM
Post
#17
|
|
|
New Member Posts: 11 |
Hi, Perhaps you could start with Crystal's Learn VBA tutorial. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) (IMG:style_emoticons/default/thanks.gif) again, again and again (IMG:style_emoticons/default/big_grin.gif) are you the savior in UA? (IMG:style_emoticons/default/uarulez2.gif) now i've to start to learn from the start (IMG:style_emoticons/default/reading.gif) This post has been edited by ryan_apessimisl: Feb 27 2012, 07:24 PM |
|
|
|
Feb 29 2012, 10:37 AM
Post
#18
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi,
Good luck with your learning. We all help out around here so just let us know if you have any more questions. Cheers (IMG:style_emoticons/default/cheers.gif) |
|
|
|
Feb 29 2012, 07:57 PM
Post
#19
|
|
|
New Member Posts: 11 |
Hi, Good luck with your learning. We all help out around here so just let us know if you have any more questions. Cheers (IMG:style_emoticons/default/cheers.gif) even though it's still not enough, i've learn a lot from you. (IMG:style_emoticons/default/thanks.gif) there're still a lot of things that i've tto learn and i'll ask you if you dont mind (IMG:style_emoticons/default/uarulez2.gif) |
|
|
|
Mar 1 2012, 06:53 PM
Post
#20
|
|
|
Access Wiki and Forums Moderator Posts: 48,017 From: SoCal, USA |
Hi Ryan,
even though it's still not enough, i've learn a lot from you. (IMG:style_emoticons/default/thanks.gif) there're still a lot of things that i've tto learn and i'll ask you if you dont mind (IMG:style_emoticons/default/uarulez2.gif) Thanks. You're welcome around here, any time. Good luck! |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 05:00 PM |