Set a value on a form

I use the following code to open a form
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Is there any way to pass data to the form (through the constructor) or to 
set the value of a label on the form

Thank you,
Samuel 


0
Samuel
5/26/2007 11:09:31 PM
access 16762 articles. 3 followers. Follow

2 Replies
826 Views

Similar Articles

[PageSpeed] 11

You can use the OpenArgs argument to pass a value to the new form, and then 
use the new form's Load event to read the value and put it into a control on 
itself.

First step -- pass the value:

DoCmd.OpenForm stDocName, , , stLinkCriteria, , "ValueToPass"



Second step - read the value and use it; this code goes with the Load event 
of the stDocName form:

Private Sub Form_Load()
Me.LabelName.Caption = Nz(Me.OpenArgs, "")
End Sub

-- 

        Ken Snell
<MS ACCESS MVP>





"Samuel" <samuel.shulman@ntlworld.com> wrote in message 
news:urZ2or%23nHHA.4220@TK2MSFTNGP04.phx.gbl...
>
> I use the following code to open a form
>    DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> Is there any way to pass data to the form (through the constructor) or to 
> set the value of a label on the form
>
> Thank you,
> Samuel
> 


0
Ken
5/26/2007 11:27:05 PM
Thank you,

Samuel

"Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message 
news:uQVkT1%23nHHA.4212@TK2MSFTNGP04.phx.gbl...
> You can use the OpenArgs argument to pass a value to the new form, and 
> then use the new form's Load event to read the value and put it into a 
> control on itself.
>
> First step -- pass the value:
>
> DoCmd.OpenForm stDocName, , , stLinkCriteria, , "ValueToPass"
>
>
>
> Second step - read the value and use it; this code goes with the Load 
> event of the stDocName form:
>
> Private Sub Form_Load()
> Me.LabelName.Caption = Nz(Me.OpenArgs, "")
> End Sub
>
> -- 
>
>        Ken Snell
> <MS ACCESS MVP>
>
>
>
>
>
> "Samuel" <samuel.shulman@ntlworld.com> wrote in message 
> news:urZ2or%23nHHA.4220@TK2MSFTNGP04.phx.gbl...
>>
>> I use the following code to open a form
>>    DoCmd.OpenForm stDocName, , , stLinkCriteria
>>
>> Is there any way to pass data to the form (through the constructor) or to 
>> set the value of a label on the form
>>
>> Thank you,
>> Samuel
>>
>
> 


0
Samuel
5/27/2007 7:21:32 AM
Reply:

Similar Artilces:

Linking Outlook fields from the "Contact Folder" to a custom form in Outlook...
Using Exchange Server 2003/Outlook 2003, we have created a custom Help Desk form in Outlook. We would like the ability to link specific fields from the Contacts Folder (Example B), in a drop-down list box if possible. We are far from knowing that something like this is even possible. Would appreciate *any* suggestions. Thank you. ...

A form to be filled in and then to be used for a query
Hi ! I'm using MS Access 2003. In my table I have yes/no fields F1 to FN. In my query I want to select records from this table according to the values of F1, ... , FN. I want to use an entry form for specifying my query. My entry form will have checkboxes for specifying the values of F1, ..., FN. A record is to be selected from my table whenever it has "yes" values for all fields checked in the entry form. (Unchecked fields are ignored .) To carry out the query, I would like to check the values in the entry form, then push a button to have another form show up which display...

email set-up: what do i put in incoming & outgoing server fields?
Im trying to set-up my outlook to recieve my emails. I would like to know what to enter in the fields(incoming server and outgoing server) if im using yahoo and or msn as my isp. Also, what type of isp's are these pop or imap? For an overview of the account settings for those ISPs see; http://www.howto-outlook.com/howto/accountsettings.htm -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- ...

Forms like the Invoice Template
I would like to design some of my own business forms similar to the Invoice template that comes with Excel 97. Can someone point me in the right direction to get started? Thanks, -- B Try: http://www.microsoft.com/downloads/details.aspx?FamilyID=5c619eb3-950b-4fc3- 8df4-88fb9ee83dc6&DisplayLang=en Watch word wrap here... HTH "Bradley M. Small" <BSmall@XNOSPAMXmjsi.com> wrote in message news:u1ZKd9YvDHA.4060@TK2MSFTNGP11.phx.gbl... > I would like to design some of my own business forms similar to the Invoice > template that comes with Excel 97. Can someone point ...

Setting up new email
Hi I recently switched to MSN Internet service and want to set up my Outlook email program to receive mail at home. I don't know the pop3 and other information to put into the program so that I can resume receiving email there. I have both Outlook Express and Outlook 200 installed on the computer, whick is running on W98SE. Thanks for any help! Terry Ray plinus74@msn.com Consult the MSN help files for the correct information. Note: Many accounts were converted to HTTP accounts only. POP3 accounts may be unavailable depending on your service package. --� Milly Staples [MVP - ...

Can my form fill in a field, yet allow me to override?
Each customers is sent to us from a salesman, and we provide service for 1-7 days before the activity ends. A new charge is generated for each day of service. Employee #1 uses the customer service form to generate a bill, and includes the name of the salesman. Employee #2 uses the form to generate a bill on the next day, and has to look up the first bill, in order to know which salesman to record. The same thing happens every day until the activity ends. With each new referral for service, there's a strong chance it will be due to a different salesman, so the customer number an...

How set totals of various cells with per colour fill value?
I have a sheet containing values as follows. April May June company 1 43 company 2 5 company 3 17 The cell values are also coured to indice a status. Somewhere beside the table I want to mention the totals of the cells, per status (so per colour). How to perform the latter? Thank you. Bart Excell 2003 See http://www.xldynamic.com/source/xld.ColourCounter.html for a working solution -- HTH Bob Phillips (remove xxx from email address if mailing direct) "AA Arens" <bartvandongen@gmail.com> wrote in mes...

Dynamic Value in Workflows
Hello, I am creating some workflows and I want to set a value in an Account Entity based on a value in the Opportunity Entity. I believe I should be able to use the Dynamic value wizard within Workflow manager - i.e. select Account and the filed and select = and then go to Dynamic Value and select Opportunity and the field that I want the value to inherit on change of status. However when I do this I can only select Account within the Dynamic Value picklist. Any ideas? Dynamic Values are only available to children of Parent entities. Since Accounts are at the top of the CRM food c...

AutoFill Changing Wrong Value
I'm trying to create an analysis sheet that gathers data from 100 worksheets within the same workbook. I want the same cell reference in each sheet, but to change the sheet number in each cell. The worksheets are named 1 - 100 Here is the formula: ='1'!B3:E3 It changes the cell references only, not the worksheets. I've changed the formula to keep the cell references: ='1'!$B$3:$E$3 I now need the formula to increment the sheet number each time, PLEASE!!! Thanks, Lisa Presumably you want to sum data from that range? Try this: =3DSUM(INDIR...

Search directly in a form
I have some members in av form, and I want to be able to in [FirstName] to just type inn the persons name and search an get hold of all the persons data in the form. Is there an easy way to do this? -- Tom R. Thorstensen On Tue, 8 Jan 2008 07:31:04 -0800, Tom R. <tomrth@broadpark.no> wrote: >I have some members in av form, and I want to be able to in [FirstName] to >just type inn the persons name and search an get hold of all the persons data >in the form. Is there an easy way to do this? Yes. On the menu select Records... Filter... Filter by Form. Type search terms in...

Calendar and Settings sometimes missing in CRM web interface
I refer to the message below from a few months ago, which Google informs me I can no longer post to... http://groups.google.com/groups?as_umsgid=E5891C96-F093-43BF-80D7-48E168ACD54E@microsoft.com Apparently there is a problem here that is caused by Outlook (with CRM client) being open when CRM web interface is loaded - that when this is done, the service schedule calendar is missing, and in my case, so is the Settings tab/section. Someone has suggested creating a different DNS alias for outlook to use to connect to the CRM, so that IE and Outlook are using different cookies. Has anyone el...

setting up Vista-microsoft mail-getting POP3 server error message
What am I doing wrong? Trying to set up my MSN-Vista-Microsoft e-mail. Get an error message about the POP3 server. I give my incoming and outgoing mail server as POP3 and service provider TWC or Time Warner Cable and the error message comes up. What should I do? Can you help me? On Tue, 7 Aug 2007 19:27:09 -0700, "asilocreo" <asilocreo@microsoft.com> wrote: >What am I doing wrong? >Trying to set up my MSN-Vista-Microsoft e-mail. Get an error message about >the POP3 server. I give my incoming and outgoing mail server as POP3 and >service provider TWC or Ti...

Forms problem #2
Hi all, I've designed a form in MSO 2003 with a picture for a background and the bcc field having a default value. The problem is that when I send attachments through this form sometimes the recipient gets the attachment as a .dat file! I like the functionality of the form that I've created but the problem with the attachments is a big one! Any suggestions? -pnp Do not use Outlook Rich Text as the form message format. Use Plain Text or HTML instead. The winmail.dat is caused by clients that cannot understand RTF (all except Outlook/Eudora) wrapping the formatting in the .da...

Trusted Code Settings.
Hi I was wondering if anyone could help me. We currently have moved to outlook xp and we have a visual basic 6 program that sends email.Since moving to outlook xp when the visual basic program sends mail these prompt box's appear which tell there is a program trying access mail and you have yes no options. I was on the microsoft site and found a security features administrive patch which we downloaded you have a couple of options on this you can set the security settings for each user manually which works fine when we do it the boxs dont pop up.But There is another option that ...

which table Picklist integer value stored?
Hi there, Which database table pick list interger values stored? thanks Kyaw this query will list all the pick list integervalues and attribute name select AttributeName,AttributeValue,Value from StringMap // for account WHERE (StringMap.ObjectTypeCode=1) //for contact WHERE (StringMap.ObjectTypeCode=2) attributename will tell u about the name of the picklist attribute value is the intigers and values are what u can see on the form i think this will help u ...

ADP in A2007 Runtime: Traditional binding of form to stored procedure taking no parameters no longer works
Forms in ADP can have a stored procedure as the RecordSource. Traditionally we could write: RecordSource="dbo.EmployeesList" (or use the RecordSourceQualifier to specify "dbo"). On A2007 runtime this no longer works: The record source 'EmployeeList' specified on this form or report does not exist. On A2007 (with or without the /runtime command line switch) it does work. The only workaround I have found so far is to put the entire expression in the RecordSource property like this: "exec dbo.EmployeesList". I don't think this is an intentional change b...

word or excel documents as web forms
Dear Mr or Mrs, I was just wondering if anyone has had a similar goal before. We have numerous word and excel docs in our company. I was wondering if there is a way to create those as web forms and bind them to a database. We dont have a problem with creating a database to fit the need. I know that an easy workaround would be to code asp.net pages from the word and excell docs but i just thought it might be worth while to ask. Having the word docs and excel docs would make printing really easy and all formating. Looking forward to any advice Sincerely Dan If you are ...

Finding the cell loacation that matches a specific value in a rang
Hi, I have a list of references in column A going from A3:A240. I need a formula that can find a specific reference within that range and give me back the location of the reference. Example: A1 7569 A2 1245 A3 3256 A4 7895 If I input 3256 it needs to return either A3 or 3. Thanks, ZUO This maybe... =MATCH(3256,A1:A100,0) Although I would probably use a cell reference in place of the hard-coded 3256 value. -- Rick (MVP - Excel) "Zuo" <Zuo@discussions.microsoft.com> wrote in message news:F6225750-C572-44A1-A914-083DFF38A1FC@...

Excel Formula
If it possible to return a value based on the color of a cell, by usin an Excel formula? I looked at =Cell() but didn't see the option. The cell is colored manually not using conditional formatting. The use of this would be to sort a list based on the color of a cell. thank -- Message posted from http://www.ExcelForum.com Hi you'll VBA code for this. Have a look at http://www.cpearson.com/excel/SortByColor.htm http://www.cpearson.com/excel/colors.htm for some ideas HTH Frank > If it possible to return a value based on the color of a cell, by > using an Excel formula? I ...

Taking one value sheet 1 and apply to sheet 2
Hello all, I have a workbook with 5 sheets. I do not know how to take the valu from sheet 5 cell b26 and use that value to a formula to sheet 1 cel g19. Can someone help me out? : -- join_the_ban ----------------------------------------------------------------------- join_the_band's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3521 View this thread: http://www.excelforum.com/showthread.php?threadid=54975 Try a formula like =Sheet5!B26 "join_the_band" <join_the_band.2926qb_1149728701.4689@excelforum-nospam.com> wrote in message news:joi...

Getting the "name=" (bit, picklist) value that is returned from SOAP
Hi all, I am getting several fields via a Web service request in javascript in an OnChange event to poulate other field on a case. One of those fields is a bit, and one is a picklist. Those nodes in the response come back with <attribute="new_active" name="true">1</attribute> for the bit field and <attribute="status" name="On Hold">3</attribute> How can I read the name value? I've tried selectSingleNode("//status").name with no luck. Thanks! I am doing a similar process, using a SOAP response message. I ge...

form: data input locking up
Hello all... I have a form which was working fine until a few hours ago. The form has several sub forms. However, those are working fine. I am unable to edit/add/delete records on the main form. This is a front end database, with the main data storage on a network. I moved the data starage DB onto my local drive, reset the links and experienced the same problem. The form is not based on a query and writes directly into a data table. The form is normally called up (filtered) through code. however, I experience the same problem when I open it up directly (without filtering the re...

setting up outlook #8
Hi, I am running Vista and I can not get Outlook to correct to my wireless service. Could someone please tell what I can try. Thanks, DK Contact your Internet Service Provider or visit their help site to get the correct server settings and instructions for setting up Outlook. Wireless is your network connection method, not your email provider. Use the Network & Sharing Center in Vista to set up your network connections. "debbie" wrote: > Hi, > I am running Vista and I can not get Outlook to correct to my wireless > service. > Could someone please tell what ...

Set Departments and Categories discount.
Is there a way to set the departments and categories to a discount price. For example i have a category name soda, can i put the whole soda category to a discount price and on sale schedule?? You can use the Inventory Wizard in Store Operations Manager -- Regards Michael (Brisbane, Australia) "TJW" <TJW@discussions.microsoft.com> wrote in message news:89FA3DB0-4F8A-4A70-BFDA-19C66D5BB708@microsoft.com... > Is there a way to set the departments and categories to a discount price. > For example i have a category name soda, can i put the whole soda category > t...

How can I send a set of files, one file per email, automatically?
I need to send about 40 files to one or two people. I'm willing to do this in Eudora or in Outlook Express or Outlook. The problem is that these files are each relatively large: around 25MB each. Combining them into one file would be prohibitive. So I want to send 40 emails, each with one file. Does either of these mailer programs make that task possible? Of course, doing it manually would not be a reasonable option. Outlook should be able to do that with a batch file but you might want to find another way of getting that much data (approx 1GB) to the recipients like via FTP serve...