PC Review


Reply
Thread Tools Rate Thread

detect form opening by tabular form or datasheet form

 
 
=?Utf-8?B?dGhlY3VvbmdqYXBhbg==?=
Guest
Posts: n/a
 
      20th Jan 2006
Hi,
Is there a way to detect form opening in tabular form or datasheet form (by
using On open event of that form)?
thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?JzY5IENhbWFybw==?=
Guest
Posts: n/a
 
      20th Jan 2006
Hi.

> Is there a way to detect form opening in tabular form or datasheet form (by
> using On open event of that form)?


Yes. Try:

Private Sub Form_Open(Cancel As Integer)

On Error GoTo ErrHandler

Select Case Me.CurrentView
Case acCurViewDatasheet
MsgBox "In datasheet view."
Case Else
MsgBox "Not in datasheet view."
End Select

Exit Sub

ErrHandler:

MsgBox "Error in Form_Open( ) in " & vbCrLf & Me.Name & _
" form." & vbCrLf & vbCrLf & "Error #" & _
Err.Number & vbCrLf & Err.Description
Err.Clear

End Sub

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


"thecuongjapan" wrote:

> Hi,
> Is there a way to detect form opening in tabular form or datasheet form (by
> using On open event of that form)?
> thanks

 
Reply With Quote
 
=?Utf-8?B?dGhlY3VvbmdqYXBhbg==?=
Guest
Posts: n/a
 
      21st Jan 2006
many Thanks for your reply

"'69 Camaro" wrote:

> Hi.
>
> > Is there a way to detect form opening in tabular form or datasheet form (by
> > using On open event of that form)?

>
> Yes. Try:
>
> Private Sub Form_Open(Cancel As Integer)
>
> On Error GoTo ErrHandler
>
> Select Case Me.CurrentView
> Case acCurViewDatasheet
> MsgBox "In datasheet view."
> Case Else
> MsgBox "Not in datasheet view."
> End Select
>
> Exit Sub
>
> ErrHandler:
>
> MsgBox "Error in Form_Open( ) in " & vbCrLf & Me.Name & _
> " form." & vbCrLf & vbCrLf & "Error #" & _
> Err.Number & vbCrLf & Err.Description
> Err.Clear
>
> End Sub
>
> HTH.
> Gunny
>
> See http://www.QBuilt.com for all your database needs.
> See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
> http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
>
> - - -
> If my answer has helped you, please sign in and answer yes to the question
> "Did this post answer your question?" at the bottom of the message, which
> adds your question and the answers to the database of answers. Remember that
> questions answered the quickest are often from those who have a history of
> rewarding the contributors who have taken the time to answer questions
> correctly.
>
>
> "thecuongjapan" wrote:
>
> > Hi,
> > Is there a way to detect form opening in tabular form or datasheet form (by
> > using On open event of that form)?
> > thanks

 
Reply With Quote
 
'69 Camaro
Guest
Posts: n/a
 
      21st Jan 2006
You're welcome.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.


"thecuongjapan" <(E-Mail Removed)> wrote in message
news:4135FB00-3C63-46AF-8960-(E-Mail Removed)...
> many Thanks for your reply
>
> "'69 Camaro" wrote:
>
>> Hi.
>>
>> > Is there a way to detect form opening in tabular form or datasheet form
>> > (by
>> > using On open event of that form)?

>>
>> Yes. Try:
>>
>> Private Sub Form_Open(Cancel As Integer)
>>
>> On Error GoTo ErrHandler
>>
>> Select Case Me.CurrentView
>> Case acCurViewDatasheet
>> MsgBox "In datasheet view."
>> Case Else
>> MsgBox "Not in datasheet view."
>> End Select
>>
>> Exit Sub
>>
>> ErrHandler:
>>
>> MsgBox "Error in Form_Open( ) in " & vbCrLf & Me.Name & _
>> " form." & vbCrLf & vbCrLf & "Error #" & _
>> Err.Number & vbCrLf & Err.Description
>> Err.Clear
>>
>> End Sub
>>
>> HTH.
>> Gunny
>>
>> See http://www.QBuilt.com for all your database needs.
>> See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
>> http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
>> info.
>>
>> - - -
>> If my answer has helped you, please sign in and answer yes to the
>> question
>> "Did this post answer your question?" at the bottom of the message, which
>> adds your question and the answers to the database of answers. Remember
>> that
>> questions answered the quickest are often from those who have a history
>> of
>> rewarding the contributors who have taken the time to answer questions
>> correctly.
>>
>>
>> "thecuongjapan" wrote:
>>
>> > Hi,
>> > Is there a way to detect form opening in tabular form or datasheet form
>> > (by
>> > using On open event of that form)?
>> > thanks



 
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
Opening a form a second time from toolbar shows Form in stead of Datasheet Roel Schreurs Microsoft Access Forms 0 2nd Oct 2006 12:13 PM
Opening a form in Datasheet view Chip Microsoft Access Forms 1 16th Apr 2005 04:36 AM
Need to make a Tabular Subform in a Tabular Main Form.... =?Utf-8?B?TWlrZQ==?= Microsoft Access Forms 1 13th Jul 2004 07:53 PM
Re: Can't get a Tabular Subform to work with a Tabular Main form.... Rick B Microsoft Access Form Coding 0 13th Jul 2004 07:52 PM
opening a datasheet record in a form Michael Nol Microsoft Access Forms 1 11th Jun 2004 12:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:42 AM.