Public variable

I am calling a public sub from a form, and I am trying to get the sub to be 
able to access a variable from the form.  I declared the variable as public 
in the forms code, but it isn't available to the subroutine... is this normal?
0
Utf
6/4/2010 4:28:19 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

1 Replies
1347 Views

Similar Articles

[PageSpeed] 42

Wavequation wrote:

>I am calling a public sub from a form, and I am trying to get the sub to be 
>able to access a variable from the form.  I declared the variable as public 
>in the forms code, but it isn't available to the subroutine... is this normal?


Public variables in a form/report/class module are a
property of the form/report/class.  That means that you need
to refer to it using object.property.  Depending on your
public sub's arguments, you can use this kind of syntax.

sub argument with name of form
	Forms(arg).variable

sub argument with form object
	arg.variable

no argument for the form
	Forms!theform.variable

-- 
Marsh
MVP [MS Access]
0
Marshall
6/4/2010 3:54:37 PM
Reply:

Similar Artilces:

Possible to set up auto reply from public folder?
We have a mailto link on a Web page that sends mail to a public folder. We would like to have an auto reply for all e-mails sent to that address without using a form. When we try to set up auto reply on that public folder mailbox, the auto reply applies to the individual's e-mail. Is it possible to set up an auto reply from a public folder? Thanks. you can use an event script to reply. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook &am...

Auto-forward from a mail-enabled public folder in Exchange 2003
We have a mail-enabled public folder that used to auto-forward to multiple people any-time it received email. Now that we have added an 2003 version of Exchange, that have been removed (by the installation?) and we are no longer able to auto-forward to more than a single person (using public folder properties) Is there something I am missing about how to get this set back up? ...

changing layout after publication is created
does anyone know if it is possible to change the layout of a blank print publication that is about 18 pages to newsletter format? thank you Can your printer print 11 x 17? If your printer can add two pages, in page setup select booklet. If the publication is blank, why not delete it and start from scratch? Publisher works in groups of four. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "katerina" <katerina@discussions.microsoft.com> wrote in message news:27160461-1AF9-4AEC-84B4-B3809195681E@microsoft.com... >...

OWA Public Folders IPM.Post
Currently I'm running Windows 2003 Small Business Server with Exchange 2003 SP1. I've done the research regarding the IPM.Post to IPM.Note conversion and I have the registry entry in place. When I send SMTP mail to my mail-enabled public folder it is converted just fine when viewing it with Outlook 2003. I can reply, forward, etc. It works like a champ! However, when I open this same public folder in OWA 2003, I only have the option "Reply to Post". Any suggestions why Outlook 2003 would display this information perfectly; however OWA isn't liking it? Thanks in a...

public calendar syncing
Hi guys, I'm having an issue with outlook 2007 and my SBS 2003 server. Basically we have a shared calendar setup in our public folders. My boss wants to view that shared calendar alongside all his other personal ones in the 'calendar' folder in outlook. Easy enough I thought just drag and drop from public folders to his 'calendar' folder. Thing is syncing between the shared calendar in the public folder and the one in his outlook calendar isnt happening. I've checked on the server that replication is set to update. Any other ideas of how to troubl...

DIM variables in an loop
Is it possible to Dim variables in a loop? My objective is to Dim 10 variables with the following naming convention. LON1Col LON2Col ... LON99Col LON100Col Using something like this. For x = 0 To 100 - 1 Dim "LON" & (x+1) & "Col" as Integer Next -- cparson ----------------------------------------------------------------------- cparsons's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1286 View this thread: http://www.excelforum.com/showthread.php?threadid=26243 On Wed, 22 Sep 2004 10:56:54 -0500, cparsons <cparsons.1czs5y@exce...

Input variable contains a duplicate document
Somehow I got this error message GP 10 when I did PO import "Input variable contains a duplicate document" It affects all PO import item. Thanks, Tim Tim, Based on the error message, it sounds like eConnect (or the eConnect adapter in Integration Manager) is being used to bring in these transactions. The first place I'd recommend checking would be the eConnect Event Log in the Event Viewer. That should give more details regarding the error along with the XML string being passed in so that you can see the exact document number that is throwing this error. Thanks, &qu...

Public Folder Replication issue #3
I have a single domain which is linked across a VPN to two sites. At both sites I have a DC and an Exchange box. The issue I am having is on Server A, I can see and access all public folders, on Server B I cannot see one folder and two other folders have no data. I have checked to ensure they are set up for replication and even in ESM it shows they are "In Sync" or "Local Modified". Any suggestions on how to resolve this would be greatly appreciated. Douglas Hiser In each public folder's properties do you have both servers showing as having replicas? Do yo...

Calendar Overlapping in Exchange 2003 Public Folders
Is there any way within Exhange to disable the ability to overlap calendar entries in Public folders? We use Public folders for conference room scheduling and when someone goes in to schedule a specific room they can easliy overlap an existing scheuled appointment for that room. Any idea's or links to details regarding this issue? "=?Utf-8?B?VGltUk0=?=" <TimRM@discussions.microsoft.com> wrote in news:D77793B2-56F8-4C40-A634-E4A71515EA04@microsoft.com: > Is there any way within Exhange to disable the ability to overlap > calendar entries in Public folders? We us...

Public folders on Exchange 5.5
How do I secure public folder creation in Exchange 5.5. We only want certain people to be able to create public folders. ...

EWS: Calendar categories lost reviewing Exchange Public Folder Calendar
Title says it all. I've created a calendar in Outlook 2007 (SBS 2008/Exchange 2007). It's in a "favorite" Public Folder so that it's reviewable by all logged in domain users and editable by two of us. Making it a favorite Public Folder calendar is what made it available to to users logging in over Outlook Web Access. However, on my Mac, none of the category attributes for appointments/events are retained by the entries. The curious thing is that the categories themselves DID make it to the Mac when I created a personal calendar that I shared with other Outlook ...

With QUERY how to input a variable
I'm using query to extract data from an external database and I would like to introduce a variable in my query Example select * from xxxxx where datein between date1 and date2 where date1 and date2 are two variables Check the parameter query section of this website: http://www.rdg.ac.uk/ITS/info/training/notes/excel/query/ Does that help? *********** Regards, Ron "Guillaume" wrote: > I'm using query to extract data from an external database and I would like to > introduce a variable in my query > Example > select * from xxxxx > where datein between date...

custom AfxMessageBox and variable argument functions
I want to use a function of only one line( (I know I am bit lazy) like this to debug my app because before I used the following three lines(only two if I define csTmp as a member variable of my class) : CString csTmp; csTmp.Format(L"return %d", 10); AfxMessageBox(csTmp); So I want to replace it with only one call to Display( L"return %d", 10); //dummy example void Display(CString csLog, ...) { // please fill here because I have no idea on how to do that. } >So I want to replace it with only one call to > >Display( L"return %d", 10); //dummy ex...

A fundamental difference between object variables and other variab
I would appreciate it if someone would explain to me why the subs Prac4 and Prac5 below work, but Prac6 does not. The error is in the debug.print statement, not the Set statement. Sub Prac4() Dim FldName As String FldName = CurrentDb().TableDefs(0).Fields(0).Name Debug.Print FldName End Sub Sub Prac5() Dim Dbs As DAO.Database Set Dbs = CurrentDb() Debug.Print Dbs.Name End Sub Sub Prac6() Dim Fld As DAO.Field Set Fld = CurrentDb().TableDefs(0).Fields(0) Debug.Print Fld.Name End Sub And the error you get is what...? -- Doug Steele, Microsof...

How can I put two variables with different scales on the same char
Plot both series together in the chart, double click on one series, and on the Axis tab, choose Secondary. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services - Tutorials and Custom Solutions - http://PeltierTech.com/ 2006 Excel User Conference, 19-21 April, Atlantic City, NJ http://peltiertech.com/Excel/ExcelUserConf06.html _______ "Candace" <Candace@discussions.microsoft.com> wrote in message news:40078D0A-0639-4721-AFD6-BE55326BCE93@microsoft.com... > ...

Public folder replication 03-01-10
I've got two Ex2k7 MBX servers, one of which i'm trying to decommission. The mailboxes have been moved and i've run the "move all replicas" powershell script for the public folder replicas. I performed the latter step a couple of times over the last two or three days. When i try to uninstall Exchange, i get the 'can't delete while replicas exist' error. Now here's the rub... Using the PF Management Console i added the column "replicas" to the default view. I went folder by folder, system and default public folders, and i verifi...

Dataset In Session Variable
Quick question... I was watching a tutorial video and in that example they created a DataSet - filled it with some data (small amount of data). Then they stored it to a session variable. On postbacks they just kept using that dataset filled data for some comparisons. I was under the impression that was a 'nono' and it is better just to refetch the data? Or is it the norm to grab a dataset and do updates and fills on it just as if it was a windows app and store it into a session variable. Thanks, Miro "Miro" <miro@beero.com> wrote in news:...

How to make a variable selection to print?
Good morning, In a excel sheet I have 12 monthly sheets (january to december) and a total sheet. Names and shifts are enterd into the monthly sheets, which are then by formula copied to the total sheet. The total sheet is sorted in alphabetical order by name. Then the information per name should be copied into a standard-letter. My problem, that in totalsheet there are not the same number of lines (it varies from 1 to 4) per name. So I don't know how to solve this with mail/merge. Is there a solution? I use Office XP. Every help is welcome, thanks already, Hans When I've e...

how to create chart with five data variables
I need to create a chart off of a spreadsheet with five variables I have to show: Room Fiscal Year (2003, 2004, 2005, 2006) Business Hour usage After-Hours usage Quantity (number of times the room was used that year) Currently I have the data as Fiscal Year in rows by Business or After Hours (FY03 Business Hours, FY03 After Hours, FY04 BH, FY04AH, etc.) Rooms in columns, and Quantity as cell value. What I want to do is create a stacked column chart that shows has Room for the X-axis value, Quanity for the Y-axis, Fiscal Year on the Z-axis (so it would be a 3-dimensional chart) and stack the ...

Public folder calendar items being added to Personal Calendars?
I've posted this numerous times on microsoft.public.outlook.calendaring without so much as a reply, so thought I'd try here... my apologies if this isn't correct either. As I'm unsure of the mechanism causing this (Exchange? Outlook?) Anyways, on to the details: Single Exchange server - W2k3 - Exchange2k3 Enterprise w/ SP2 Clients - W2k & XP SP2 - Outlook2k3 SP2 Last year, I created a Public Folder for calendar items (IPM.appointments) to allow the departments mgr. (or others within the dept) to track various calendar events of the entire dept. (planned absences, vacati...

Public Folders and unread message count....
Hi there, I know this topic may seem like an old chestnut, but despite having trawled through several groups I can't seem to find an answer! I'm fairly new to Exchange 2000 and have just set it up on our local server. I've installed all the service packs and patches (or at least I think I have) and have setup a Public folder. The problem is that the folder does not display any unread message count at all from with Outlook. Is there a fix for this? Does anyone know the solution? Any help would be most appreciated... Regards, Jason Needapresent.com In news:1131637134.39389...

Blank Publication not opening
Hi there! I have a strange problem with Publisher 2000 version 6.0 on XP Professional - Whenever a certain user tries to open a blank publication I get a message saying an error has occured and that Publisher has to shut down. For every other users on the machine it's fine. I've tried uninstalling and re installing but no difference. Any ideas? Many thanks in advance . Your wording is interesting. (Certain user opens a file - *you* get an error message.) Do you mean you have several people using the same system and after this person uses it, you have problems? I'd sugge...

Deleting Public Holidays
After entering public holidays for a country in O2003, how do you delete them? I find that countries I imported from the previous version of Outlook are not even checked so I cannot uncheck them to delete them. Outlook seems oblivious to them. Thanks, Andrew Sort you Calendar in the By Category view. You can now easily remove the Holidays. -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -What do the Outlook Icons Mean? -Create an Office 2003 CD slipstreamed with Service Pack 1 ----- "Andrew Chalk" <achalk@XXXmagnacartasoftware.com> wrote in ...

Multiple/Large Pivot Tables for Publication
Hello everyone...a little advise would be appreciated. We have some very complex and large pivot tables that use data downloaded as text files from the web. That in itself is a problem because the data must be"prepared" in order to work with it in Excel. We have many pivot tables, most of which were copied by using the Move or Copy function. Originally the problem that was the most frustrating was changing the data source as it was always changing...larger or smaller. I created an offset formula to set the data range and that solved the problem. But, it seems that when peo...

Secure OWA public folders
Hello We are running Exchange 2003/ OWA at a church. We have a "public calendar" for scheduling church events, and want members(public) to have view only access to a calendar via OWA. e.g https://webmail.organization.org/public/chpc_calendar It works but anon-user can create entries in the calendar. I want to know how to prevent anonymous user from creating entries in a "public calendar' in Public folders. I have tried removing Anon-users from public folder/ gave it only read permissions in System manager but no luck. Is there any way to do this without affecting...