PC Review


Reply
Thread Tools Rate Thread

CheckBox to open Portrait or Landscape report

 
 
Bob V
Guest
Posts: n/a
 
      26th May 2007

Private Sub cbCategory_Click()
DoCmd.OpenReport "rptPrintMainCategoryRemark", acViewPreview
End Sub

This is what I have at the moment but would like to change it too, My
Checkbox Yes/No [ckbPortrait] on record source of My form
:
Private Sub cbCategory_Click()
If ckbPortrait =True, DoCmd.OpenReport "rptPrintMainCategoryRemarkPort",
acViewPreview
or
If ckbPortrait = False, DoCmd.OpenReport "rptPrintMainCategoryRemark",
acViewPreview
End Sub

Thanks for any help.....Bob


 
Reply With Quote
 
 
 
 
Rob Parker
Guest
Posts: n/a
 
      27th May 2007
Private Sub cbCategory_Click()
If ckbPortrait = True Then
DoCmd.OpenReport "rptPrintMainCategoryRemarkPort", acViewPreview
Else
DoCmd.OpenReport "rptPrintMainCategoryRemark",
End If
End Sub

Since ckbPortrait is a checkbox, it can only have a value of True (Yes) or
False (No), so you can simplify the If statement to just:
If ckbPortrait Then
The longer version may make it simpler to understand when you re-visit it
later ;-)

HTH,

Rob


"Bob V" <(E-Mail Removed)> wrote in message
news:u%23d%23bl%(E-Mail Removed)...
>
> Private Sub cbCategory_Click()
> DoCmd.OpenReport "rptPrintMainCategoryRemark", acViewPreview
> End Sub
>
> This is what I have at the moment but would like to change it too, My
> Checkbox Yes/No [ckbPortrait] on record source of My form
> :
> Private Sub cbCategory_Click()
> If ckbPortrait =True, DoCmd.OpenReport "rptPrintMainCategoryRemarkPort",
> acViewPreview
> or
> If ckbPortrait = False, DoCmd.OpenReport "rptPrintMainCategoryRemark",
> acViewPreview
> End Sub
>
> Thanks for any help.....Bob
>



 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      27th May 2007
Hi Rob, Thanks but I am getting a red font error:
Private Sub cbCategory_Click()
If ckbPortrait = True Then
DoCmd.OpenReport "rptPrintMainCategoryRemarkPort", acViewPreview
Else
DoCmd.OpenReport "rptPrintMainCategoryRemark",'*****RED FONT***
End If
End Sub

"Rob Parker" <(E-Mail Removed)> wrote in message
news:%23JU5tB$(E-Mail Removed)...
> Private Sub cbCategory_Click()
> If ckbPortrait = True Then
> DoCmd.OpenReport "rptPrintMainCategoryRemarkPort", acViewPreview
> Else
> DoCmd.OpenReport "rptPrintMainCategoryRemark",
> End If
> End Sub
>
> Since ckbPortrait is a checkbox, it can only have a value of True (Yes) or
> False (No), so you can simplify the If statement to just:
> If ckbPortrait Then
> The longer version may make it simpler to understand when you re-visit it
> later ;-)
>
> HTH,
>
> Rob
>
>
> "Bob V" <(E-Mail Removed)> wrote in message
> news:u%23d%23bl%(E-Mail Removed)...
>>
>> Private Sub cbCategory_Click()
>> DoCmd.OpenReport "rptPrintMainCategoryRemark", acViewPreview
>> End Sub
>>
>> This is what I have at the moment but would like to change it too, My
>> Checkbox Yes/No [ckbPortrait] on record source of My form
>> :
>> Private Sub cbCategory_Click()
>> If ckbPortrait =True, DoCmd.OpenReport "rptPrintMainCategoryRemarkPort",
>> acViewPreview
>> or
>> If ckbPortrait = False, DoCmd.OpenReport "rptPrintMainCategoryRemark",
>> acViewPreview
>> End Sub
>>
>> Thanks for any help.....Bob
>>

>
>



 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      27th May 2007
oops sorry took away the comer....Thanks Bob

"Rob Parker" <(E-Mail Removed)> wrote in message
news:%23JU5tB$(E-Mail Removed)...
> Private Sub cbCategory_Click()
> If ckbPortrait = True Then
> DoCmd.OpenReport "rptPrintMainCategoryRemarkPort", acViewPreview
> Else
> DoCmd.OpenReport "rptPrintMainCategoryRemark",
> End If
> End Sub
>
> Since ckbPortrait is a checkbox, it can only have a value of True (Yes) or
> False (No), so you can simplify the If statement to just:
> If ckbPortrait Then
> The longer version may make it simpler to understand when you re-visit it
> later ;-)
>
> HTH,
>
> Rob
>
>
> "Bob V" <(E-Mail Removed)> wrote in message
> news:u%23d%23bl%(E-Mail Removed)...
>>
>> Private Sub cbCategory_Click()
>> DoCmd.OpenReport "rptPrintMainCategoryRemark", acViewPreview
>> End Sub
>>
>> This is what I have at the moment but would like to change it too, My
>> Checkbox Yes/No [ckbPortrait] on record source of My form
>> :
>> Private Sub cbCategory_Click()
>> If ckbPortrait =True, DoCmd.OpenReport "rptPrintMainCategoryRemarkPort",
>> acViewPreview
>> or
>> If ckbPortrait = False, DoCmd.OpenReport "rptPrintMainCategoryRemark",
>> acViewPreview
>> End Sub
>>
>> Thanks for any help.....Bob
>>

>
>



 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      27th May 2007
Rob, Tried it with this print option but got an error:
"You can not set Record Source property in print preview or after printing
has started"
Thanks for any help...bob

Private Sub cbCategory_Click()

If ckbPortrait = True Then
DoCmd.OpenReport "rptPrintRemarksPort", acViewPreview, , , ,
"Category Print Remark of Horse"
Else
DoCmd.OpenReport "rptPrintRemarks", acViewPreview, , , , "Category
Print Remark of Horse"
End If
End Sub

"Bob V" <(E-Mail Removed)> wrote in message
news:uzbr1H$(E-Mail Removed)...
> oops sorry took away the comer....Thanks Bob
>
> "Rob Parker" <(E-Mail Removed)> wrote in
> message news:%23JU5tB$(E-Mail Removed)...
>> Private Sub cbCategory_Click()
>> If ckbPortrait = True Then
>> DoCmd.OpenReport "rptPrintMainCategoryRemarkPort", acViewPreview
>> Else
>> DoCmd.OpenReport "rptPrintMainCategoryRemark",
>> End If
>> End Sub
>>
>> Since ckbPortrait is a checkbox, it can only have a value of True (Yes)
>> or False (No), so you can simplify the If statement to just:
>> If ckbPortrait Then
>> The longer version may make it simpler to understand when you re-visit it
>> later ;-)
>>
>> HTH,
>>
>> Rob
>>
>>
>> "Bob V" <(E-Mail Removed)> wrote in message
>> news:u%23d%23bl%(E-Mail Removed)...
>>>
>>> Private Sub cbCategory_Click()
>>> DoCmd.OpenReport "rptPrintMainCategoryRemark", acViewPreview
>>> End Sub
>>>
>>> This is what I have at the moment but would like to change it too, My
>>> Checkbox Yes/No [ckbPortrait] on record source of My form
>>> :
>>> Private Sub cbCategory_Click()
>>> If ckbPortrait =True, DoCmd.OpenReport "rptPrintMainCategoryRemarkPort",
>>> acViewPreview
>>> or
>>> If ckbPortrait = False, DoCmd.OpenReport "rptPrintMainCategoryRemark",
>>> acViewPreview
>>> End Sub
>>>
>>> Thanks for any help.....Bob
>>>

>>
>>

>
>



 
Reply With Quote
 
missinglinq via AccessMonster.com
Guest
Posts: n/a
 
      27th May 2007
The problem with this code:

If ckbPortrait = True Then
DoCmd.OpenReport "rptPrintRemarksPort", acViewPreview, , , , "Category
Print Remark of Horse"
Else
DoCmd.OpenReport "rptPrintRemarks", acViewPreview, , , , "Category
Print Remark of Horse"

is that you have the DoCmd.OpenReport taking 6 arguments, when it only
accepts 4 arguments!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200705/1

 
Reply With Quote
 
JK
Guest
Posts: n/a
 
      28th May 2007
Hi Bob,

Looks like it is something that is happening *after* the report has been
opened, possibly something to do with the OpenArgs "Category Print Remark of
Horse". What is "Category Print Remark of Horse" ?

Regards
Jacob


"Bob V" <(E-Mail Removed)> wrote in message
news:OZWoBq$(E-Mail Removed)...
| Rob, Tried it with this print option but got an error:
| "You can not set Record Source property in print preview or after printing
| has started"
| Thanks for any help...bob
|
| Private Sub cbCategory_Click()
|
| If ckbPortrait = True Then
| DoCmd.OpenReport "rptPrintRemarksPort", acViewPreview, , , ,
| "Category Print Remark of Horse"
| Else
| DoCmd.OpenReport "rptPrintRemarks", acViewPreview, , , , "Category
| Print Remark of Horse"
| End If
| End Sub
|
| "Bob V" <(E-Mail Removed)> wrote in message
| news:uzbr1H$(E-Mail Removed)...
| > oops sorry took away the comer....Thanks Bob
| >
| > "Rob Parker" <(E-Mail Removed)> wrote in
| > message news:%23JU5tB$(E-Mail Removed)...
| >> Private Sub cbCategory_Click()
| >> If ckbPortrait = True Then
| >> DoCmd.OpenReport "rptPrintMainCategoryRemarkPort", acViewPreview
| >> Else
| >> DoCmd.OpenReport "rptPrintMainCategoryRemark",
| >> End If
| >> End Sub
| >>
| >> Since ckbPortrait is a checkbox, it can only have a value of True (Yes)
| >> or False (No), so you can simplify the If statement to just:
| >> If ckbPortrait Then
| >> The longer version may make it simpler to understand when you re-visit
it
| >> later ;-)
| >>
| >> HTH,
| >>
| >> Rob
| >>
| >>
| >> "Bob V" <(E-Mail Removed)> wrote in message
| >> news:u%23d%23bl%(E-Mail Removed)...
| >>>
| >>> Private Sub cbCategory_Click()
| >>> DoCmd.OpenReport "rptPrintMainCategoryRemark", acViewPreview
| >>> End Sub
| >>>
| >>> This is what I have at the moment but would like to change it too, My
| >>> Checkbox Yes/No [ckbPortrait] on record source of My form
| >>> :
| >>> Private Sub cbCategory_Click()
| >>> If ckbPortrait =True, DoCmd.OpenReport
"rptPrintMainCategoryRemarkPort",
| >>> acViewPreview
| >>> or
| >>> If ckbPortrait = False, DoCmd.OpenReport "rptPrintMainCategoryRemark",
| >>> acViewPreview
| >>> End Sub
| >>>
| >>> Thanks for any help.....Bob
| >>>
| >>
| >>
| >
| >
|
|


 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      28th May 2007
Thanks Jacob.............Bob
Case "Category Print Remark of Horse"

strSQL = "SELECT * FROM tblRemarks WHERE HorseID=" _
& Form_frmHorseInfo.tbHorseID.value & " and Category='" &
Form_frmHorseInfo.cbCategory & "' ORDER BY dtDate DESC,tblRemarks.Remark
ASC;"
SrNo.ControlSource = "SrNo"
tbHorseName.Visible = True
SrNo.Visible = True
tbDate.Visible = True
lblDate.Visible = True

lblRemarkID.Visible = False
tbRemarkID.Visible = False
tbHorseName.ControlSource = "=[Forms]![frmHorseInfo]![tbNameToDisplay]"
tbRemarks.Visible = False
tbRemarkID.ControlSource = ""
tbHorseName.Visible = True

"JK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Bob,
>
> Looks like it is something that is happening *after* the report has been
> opened, possibly something to do with the OpenArgs "Category Print Remark
> of
> Horse". What is "Category Print Remark of Horse" ?
>
> Regards
> Jacob
>
>
> "Bob V" <(E-Mail Removed)> wrote in message
> news:OZWoBq$(E-Mail Removed)...
> | Rob, Tried it with this print option but got an error:
> | "You can not set Record Source property in print preview or after
> printing
> | has started"
> | Thanks for any help...bob
> |
> | Private Sub cbCategory_Click()
> |
> | If ckbPortrait = True Then
> | DoCmd.OpenReport "rptPrintRemarksPort", acViewPreview, , , ,
> | "Category Print Remark of Horse"
> | Else
> | DoCmd.OpenReport "rptPrintRemarks", acViewPreview, , , , "Category
> | Print Remark of Horse"
> | End If
> | End Sub
> |
> | "Bob V" <(E-Mail Removed)> wrote in message
> | news:uzbr1H$(E-Mail Removed)...
> | > oops sorry took away the comer....Thanks Bob
> | >
> | > "Rob Parker" <(E-Mail Removed)> wrote in
> | > message news:%23JU5tB$(E-Mail Removed)...
> | >> Private Sub cbCategory_Click()
> | >> If ckbPortrait = True Then
> | >> DoCmd.OpenReport "rptPrintMainCategoryRemarkPort",
> acViewPreview
> | >> Else
> | >> DoCmd.OpenReport "rptPrintMainCategoryRemark",
> | >> End If
> | >> End Sub
> | >>
> | >> Since ckbPortrait is a checkbox, it can only have a value of True
> (Yes)
> | >> or False (No), so you can simplify the If statement to just:
> | >> If ckbPortrait Then
> | >> The longer version may make it simpler to understand when you
> re-visit
> it
> | >> later ;-)
> | >>
> | >> HTH,
> | >>
> | >> Rob
> | >>
> | >>
> | >> "Bob V" <(E-Mail Removed)> wrote in message
> | >> news:u%23d%23bl%(E-Mail Removed)...
> | >>>
> | >>> Private Sub cbCategory_Click()
> | >>> DoCmd.OpenReport "rptPrintMainCategoryRemark", acViewPreview
> | >>> End Sub
> | >>>
> | >>> This is what I have at the moment but would like to change it too,
> My
> | >>> Checkbox Yes/No [ckbPortrait] on record source of My form
> | >>> :
> | >>> Private Sub cbCategory_Click()
> | >>> If ckbPortrait =True, DoCmd.OpenReport
> "rptPrintMainCategoryRemarkPort",
> | >>> acViewPreview
> | >>> or
> | >>> If ckbPortrait = False, DoCmd.OpenReport
> "rptPrintMainCategoryRemark",
> | >>> acViewPreview
> | >>> End Sub
> | >>>
> | >>> Thanks for any help.....Bob
> | >>>
> | >>
> | >>
> | >
> | >
> |
> |
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
portrait and landscape in one report? Eric Microsoft Access VBA Modules 0 27th May 2010 08:55 PM
change report from portrait to landscape =?Utf-8?B?R2VvcmdlIFdhbHRlcnM=?= Microsoft Access Reports 1 4th Jul 2006 08:09 PM
Portrait and Landscape on 1 Report Drew Microsoft Access Reports 1 31st May 2006 06:09 AM
Portrait / Landscape Report andrew Microsoft Access Reports 3 9th Jul 2005 03:12 AM
Portrait & Landscape on same report? Carrie Microsoft Access Reports 1 20th Feb 2004 07:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:09 PM.