PC Review


Reply
Thread Tools Rate Thread

Dialogue Box and associated code...

 
 
=?Utf-8?B?TGVuUA==?=
Guest
Posts: n/a
 
      3rd Jun 2004
I have a module that contains all the code, nothing on the forms. In one function, I issue an OpenForm to open a single-control form that prompts for a year to be entered and press OK to close the form
DoCmd.OpenForm ("frmEnterYear"
strYear = [Forms]![frmEnterYear]![txtYear
The form gets opened and for some reason, execution of code continues to the next line without waiting for the user to press OK
I know it's something stupid but I can't seem to figure it out. Any thoughts

TIA, LenP
 
Reply With Quote
 
 
 
 
Tim Ferguson
Guest
Posts: n/a
 
      3rd Jun 2004
"=?Utf-8?B?TGVuUA==?=" <(E-Mail Removed)> wrote in
news:1578ED65-ED3C-46CA-A97D-(E-Mail Removed):

> DoCmd.OpenForm ("frmEnterYear")
> strYear = [Forms]![frmEnterYear]![txtYear]
> The form gets opened and for some reason, execution of code continues


That is the wonder of event-oriented programming!

You might want to look up help on the OpenForm method, and in particular
look up the vbModal parameter.

Hope that helps


Tim F

 
Reply With Quote
 
=?Utf-8?B?TGVuUA==?=
Guest
Posts: n/a
 
      3rd Jun 2004
Thanks Tim
The form is set for Modal=Yes. What I ended up doing was

Do Until Isloaded("frmEnterYear") = Fals
DoEvent
Loo
 
Reply With Quote
 
solex
Guest
Posts: n/a
 
      3rd Jun 2004
No, No, No,

Len, please set the following properties:

Pop Up = Yes
Modal = Yes
Border Style = Dialog

Then open your form using the parameters:

DoCmd.OpenForm myFormName, acNormal, , myWhereClause, acFormEdit, acDialog


"LenP" <(E-Mail Removed)> wrote in message
news:F5B8348C-4BC8-48B5-9605-(E-Mail Removed)...
> Thanks Tim!
> The form is set for Modal=Yes. What I ended up doing was:
>
> Do Until Isloaded("frmEnterYear") = False
> DoEvents
> Loop
> .
> .
> .
> Private Function Isloaded(frmName As String) As Boolean
> Dim frm As Form
> ' Enumerate Forms collection.
>
> For Each frm In Forms
> If frm.Name = frmName Then
> Isloaded = True
> Exit Function
> End If
> Next frm
> Isloaded = False
>
> End Function
>



 
Reply With Quote
 
=?Utf-8?B?TGVuUA==?=
Guest
Posts: n/a
 
      3rd Jun 2004
Thanks Solex, works slick as sh*t off a shovel

I had the form properties set properly for modal etc, however I wasn't using all the OpenForm parms

BTW, I'm assuming that the acNormal isn't necessary since it is the default

Cheers
Len
 
Reply With Quote
 
solex
Guest
Posts: n/a
 
      3rd Jun 2004
That is correct...

Have fun,
Dan

"LenP" <(E-Mail Removed)> wrote in message
news:5F265DCC-5607-44F9-9098-(E-Mail Removed)...
> Thanks Solex, works slick as sh*t off a shovel!
>
> I had the form properties set properly for modal etc, however I wasn't

using all the OpenForm parms.
>
> BTW, I'm assuming that the acNormal isn't necessary since it is the

default.
>
> Cheers,
> Len



 
Reply With Quote
 
solex
Guest
Posts: n/a
 
      3rd Jun 2004
A collection is a generic list and contain anything you want. If you want
it to hold something other then a string you will have to build it. For
instance you could create a class with the following properties

Public Class: Person

Name As String
Sex As String * 1
FavoriteBeverage As String
etc...

Dim coll as New Collection

Dim x as New Person
x.Name = "Dan"
x.Sex = "M"
x.FavoriteBeverage = "Stella"

coll.Add(x)


"LenP" <(E-Mail Removed)> wrote in message
news:B3762109-A52C-4C86-95B5-(E-Mail Removed)...
> Dan:
>
> One question... is a collection like a recordset, in that you can have

more than one 'item/field', i.e. name, sex, fav bevvy or do they only
contain a collection of one item, ie, names
>
> Cheers,
> Len



 
Reply With Quote
 
=?Utf-8?B?TGVuUA==?=
Guest
Posts: n/a
 
      4th Jun 2004
Thanks Dan
That makes it very clear. What I'm trying to do is build a table of files that are older than a specific date. I am able to build that table, however I can't seem to come up with a clear method of getting the file size for each file. I looked at the .size property, however it seems only to work with an object and I really have not specified any
Any thoughts
TIA
Len
 
Reply With Quote
 
solex
Guest
Posts: n/a
 
      4th Jun 2004
Len, try this: FileLen(PathToYourFile)

"LenP" <(E-Mail Removed)> wrote in message
news:BF6783FA-5311-468A-BEA5-(E-Mail Removed)...
> Thanks Dan!
> That makes it very clear. What I'm trying to do is build a table of files

that are older than a specific date. I am able to build that table, however
I can't seem to come up with a clear method of getting the file size for
each file. I looked at the .size property, however it seems only to work
with an object and I really have not specified any.
> Any thoughts?
> TIA,
> Len



 
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
Code to run dialogue box at workbook startup Doo0592 Microsoft Excel Programming 8 1st Sep 2006 09:30 AM
code for print dialogue =?Utf-8?B?Qm9yaXNT?= Microsoft Excel Programming 2 18th Jun 2006 12:23 PM
AutoExec Code to Open Template Dialogue on Startup =?Utf-8?B?RGVybW90?= Microsoft Excel Programming 2 1st Mar 2006 01:10 AM
Can 'Save MDE as' dialogue be opened in code =?Utf-8?B?VGhvbWFzQUo=?= Microsoft Access Form Coding 4 18th Jun 2005 02:09 PM
Code to send report directly to printer (or bring up printer dialogue box)? Nimrod Microsoft Access Macros 3 1st Mar 2005 01:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 AM.