Automation: Open DB & Form, Run Function/Select Listbox

A user is in Database A. They open project #52. They then hit a
button. I need it to:

(1) Open a second Database B -- I got this working with:
	.OpenCurrentDatabase constrDBName

(2) Open a specifc form in DB B -- I got this working with:
	appAccess.DoCmd.OpenForm "frm_test"

(3) Select specific record #52 on "frm_test". The problem is that a
simple Filter *won't* work because I need to call a function so that a
half dozen variables can be set, do some null checks, etc

I need it to run this function: Open_Project(52) and pass the 52
Project_ID variable. I can  use .DoCmd.RunMacro, to run a RunCode
command, to call my function. But I can't figure out how to pass 52 to
a Macro.

Or I need it to open the form, select #52 in a Listbox called
Me.List_Projects, then run Open_Project(). The function will go to the
Listbox to know which Project ID to select. But I can't figure out how
to select #52 in a Listbox via Automation.

Summary: How do I use automation to either call a function in another
database and pass it a variable, or how do I pass a variable via
DoCmd.RunMacro, or how do I use automation to select a specific record
in a Listbox?

Thanks,

Chris

0
wrldruler
6/22/2007 7:13:24 PM
access 16762 articles. 3 followers. Follow

1 Replies
723 Views

Similar Articles

[PageSpeed] 44

This may be helpful to you as I'm sure there are a few different ways of 
doing what your asking.
What if you had a table where you populated the "variable" 52, then when 
opening the form, query or report, the criteria is based upon that value.  
This table would likely be a table in the first database, in which the second 
database has a link to.  Something to consider.

SteveD

"wrldruler" wrote:

> A user is in Database A. They open project #52. They then hit a
> button. I need it to:
> 
> (1) Open a second Database B -- I got this working with:
> 	.OpenCurrentDatabase constrDBName
> 
> (2) Open a specifc form in DB B -- I got this working with:
> 	appAccess.DoCmd.OpenForm "frm_test"
> 
> (3) Select specific record #52 on "frm_test". The problem is that a
> simple Filter *won't* work because I need to call a function so that a
> half dozen variables can be set, do some null checks, etc
> 
> I need it to run this function: Open_Project(52) and pass the 52
> Project_ID variable. I can  use .DoCmd.RunMacro, to run a RunCode
> command, to call my function. But I can't figure out how to pass 52 to
> a Macro.
> 
> Or I need it to open the form, select #52 in a Listbox called
> Me.List_Projects, then run Open_Project(). The function will go to the
> Listbox to know which Project ID to select. But I can't figure out how
> to select #52 in a Listbox via Automation.
> 
> Summary: How do I use automation to either call a function in another
> database and pass it a variable, or how do I pass a variable via
> DoCmd.RunMacro, or how do I use automation to select a specific record
> in a Listbox?
> 
> Thanks,
> 
> Chris
> 
> 
0
Utf
6/22/2007 9:58:02 PM
Reply:

Similar Artilces:

open dba files
I have Windows 2003 and Palm 1S. Trying to recover Palm archive data in .dba format. Windows won't let me cut or paste file from archive to pda. Can anyone help? Thanks. And your Word question is? "ShirleyD" <ShirleyD@discussions.microsoft.com> wrote in message news:301AF667-A258-49F3-B32C-9715B96B0DBD@microsoft.com... :I have Windows 2003 and Palm 1S. Trying to recover Palm archive data in ..dba : format. Windows won't let me cut or paste file from archive to pda. Can : anyone help? Thanks. ...

Open saved projects automatically?
Hello, i used to be able to double click on my saved projects for Excel, Word, etc, and they would open in their respective application, but for some reason when i do so now the Aplication in question loads up, but doesnt open the saved project i have selected. I then have to go to File, Open. I have tried all the normal routes like right clicking on the project selecting properties and selecting 'opens with' and selecting the correct aplication and always use this, but it still doesnt open. I can also right click, open with and its fine. The strange thing is that if i have a pr...

Check box in Forms Toolbar
How do I make a check box bigger? Rob, Teesside, UK I don't believe it is possible to change the size of the checkbox. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "abfabrob" <abfabrob@discussions.microsoft.com> wrote in message news:AC393618-0FA7-4CFB-9BA2-DEED22793E32@microsoft.com... > How do I make a check box bigger? > > Rob, > Teesside, > UK ...

Owner draw listbox #2
Hi, I noticed the wireless scan dialog in windows xp sp2, when you click on an item in the listbox that items height is changed. How do I do that? I have used the MeasureItem(LPMEASUREITEMSTRUCT lpMIS) function but in that one I can only change all items. Do I have to keep track of this myself in DrawItem? any good advice how to do this? thanks! Mike wrote: >Hi, >I noticed the wireless scan dialog in windows xp sp2, when you click on an >item in the listbox that items height is changed. >How do I do that? >I have used the MeasureItem(LPMEASUREITEMSTRUCT lpMIS) function ...

Opening my app from context menu
Hi, I have found out that my problem with opening a file from the context menu is caused by the fact that the main frame is created after the document is loaded (SDI MFC). When the program is opened first and then a file is opened or drag'n'dropped into it, the frame is created first. ...

Select, Modify, and Append Question
I need to select a set of records from a table, add the same date (any date) to each returned record and then append that to yet another table. I have tblEmployeeProduction which has EmployeeID, ProdDate, Department, Shift, and TotalHoursWorked. I have qryEmpShiftHours that queries tblEmployees.EmployeeID, tblEmployees.Department, tblEmployees.Shift, tblDepartment.Department, tblShift.Shift and tblShift.ShiftHours (different shifts have different hours). I have frmEmpShiftHours which has txtProdDate (unbound), cboDept, cboShift, and cmdRunQuery which returns qryEmpSetHours filtered on cboDe...

Running Outlook XP and 2003 side-by-side
I am responsible for supporting users in both 2002 and 2003 clients. How can I run both versions side-by-side on the same machine (the laptop that I take for training sessions)... -s. No can do... only one Outlook version allowed, but multiple versions of other Office components may be used. "-= shaunna =-" <shaunna.jagneaux@gwmail.maricopa.edu> wrote in message news:OtMkTK3zDHA.3416@tk2msftngp13.phx.gbl... > I am responsible for supporting users in both 2002 and 2003 clients. How > can I run both versions side-by-side on the same machine (the laptop that I > ta...

Conditional DB reports
I have a database that has two field, one by company and another by group name. I sort the report by a data range, which I use a form to select the dates, company and group. My question is how to I write an expression in a text field when the company is null it will select or use the group name. Currently I am getting all records even when the company field is null. =IIf(IsNull([Form]![Report Date Range]![cboCompany])," ",[Forms]![Report Date Range]![cboGroup]) Thanks, I think there is a disconnect here. Databases have tables, queries, forms, reports, code,......

Display Count of records from subform on Main form
I need to show a count of records for doc on main form. Doc info is on main form and list of pts is on subform. I have entered an unbound text box on the main form and have tried DCount, ABSSum and Count all I get is 0. This is what I have entered: =DCount([ID]) or ABS(Sum([myfrom].[ID]) and =Count([ID]). Thank you in advance for any help you can provide. Thank you. Try it this way: Create a query with the needed table. Add the id-field to the grid. Total it by Count. Save the query and on the form you place an unbound field. In VBA you can do a Dlookup for the one field in the q...

The form required to view this message cannot be displayed. Contact your help ad
I'm trying to open email that contains forwarded email's. I'm using Outlook 2002 w/SP-2 and XP Pro on clean installs. I can save the attachments but would like to just display them if possible. ...

automatically update data validation selections
I've restricted user enter for certain cells to a named range. Fo example, the named range includes: Apples, Oranges, Bananas. Let's say a user selects "Apples". Then, the list is updated so tha "Apples" becomes "Green Apples". I want what the user selecte ("Apples") to now automatically reflect "Green Apples". I canno figure out how to accomplish this without using a combo box - but really don't want to use a combo box - just keep the user entry area a cells. Any suggestions with no code or a minimum of code are much appr...

Help!, Adding Custom Forms in CRM
HI Mike, I guess, you have very good exposure to the forms customization in CRM. Could u please help me with this issue. I have a list of products in a seperate database outside CRM. The quantity on hand field in that database is real. Now what I really need is to have a button or toolbar item on the OrderProducts form to Check for availability of the product. I do have the product GUID in the external table. I will have get the currently selected product's guid from orderproduct screen and pass this to a custom aspx page. This custom aspx page will find the available qty and sh...

Infopath 2003, MOSS 2007, email form contents
I need to use our SharePoint site to send user support requests via email. So I created a from in InfoPath 2003 with the necessary fields, added a button to submit it to email as an action, and published it to a document library. And it almost does what I want except: 1) I'd like to put the user info (from the text boxes on the form) into the body of the email instead of as an attachment 2) The user has to actually go into the document library and click the New button. I'd rather maybe create a view that just has a button that does the New functionality? Then I can show j...

JET dB Newbie Needs Help
Hello all, I'm haveing a bit of a problem with writing to a jet dB and looking for a little help. The problem is that for some reason data is sudenly being written to the end of the new data which is appearing BEFORE the older data. It is as though JET does not recognize the fact that the older data even exists. Each time a record is added it writes it to the end of the more recent data and pushes down all the previously existing data. This is how I open the dB and recordset: (please excuse word wraping) Set eScalperDB = OpenDatabase("C:\Documents and Settings\My Databases\eScal...

Does CRM have the same basic functions as GoldMine?
I am looking to change our systems, we currently use GoldMine . We want to start using mobile technology. Does CRM allow you to attach notes when completing an appointment and then report on all the contacts linked to a project displaying name, company, notes for a particular meeting. Example, I create a project called Senior Candidates, lets say there are 15 people attached to this project, I create a call back and then complete it on all the candidates. I then setup meetings to see 5 people and complete them. I add notes to all the appointments and calls. Can I print out a report to ...

Search form without allowing edits, deletions or additions
I have a form which has a search combo box attached. I would like this form to be searched only, with no amendments,deletions, additions or otherwise. If I set 'Allow Edits', 'Allow Deletions', 'Allow Additions' and 'Data Entry' to "No" then the combo search does not work. If I 'Allow Edits' it does but then users can adjust the records. Is it possible to allow this search to take place without the possibility of any amendment being made? Sandy Define "doesn't work," does it give an error message or just not search? Is...

How can you put double quotes in the parameter of the INDIRECT() function ?
How can you put double quotes in the parameter of the INDIRECT() function ? Example .. =SUMIF(mysheet1!$B$2:$B$200,">0",mysheet2!F$2:F$200) I want to run the above formula in the INDIRECT function like . INDIRECT ("=SUMIF(mysheet1!$B$2:$B$200,">0",mysheet2!F$2:F$200)") But the " around the >0 is causing a problem because INDIRECT thinks you have come to the end of the literal parameter - but I haven't - I literally want the double quotes passed to INDIRECT as part of its parameter. "tur13o" <research@basingstoke.plu...

Run Time Error 3027
Running Access 2007 with an Pervasive SQL database and everytime I try to add a record I get this error and tell me the record is read-only. I use the same procedure in other updates and works fine. Needing Help. Hi, if you are talking about liked table - then make sure that table has primary key -- Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com "AskingQuestion" <AskingQuestion@discussions.microsoft.com> wrote in message news:E6A895BE-AD5E-4BB8-96BA-D5AA439BC84E@microsoft.com... > Running Access 2007 wit...

Selecting nearest under in a list
I have a list of numbers and i need to either highlight (using conditional formatting)or display in another cell the nearest number under 10000 i.e 9854 9752 11254 10987 9974 <--------- 10025 Help!!!!! if your values are in column A then on the column B type this =IF(A1=MAX(IF(A1:A6<10000,A1:A6)),A1,"") and array enter it (Ctrl+shift+enter) instead of enter This will place the value that is closest to 10K on column B "Purfleet" <Purfleet@discussions.microsoft.com> wrote in message news:655D632A-44CB-4148-91AF-A36F6C1D2E1A@microsoft.com... >I have a...

Outlook 2007 Calendar will not open in Windows 7
For no apparent reason, my Outlook 2007 calendar will no longer open. Outlook itself opens fine, I can send and receive email and I can access my contacts, tasks and notes. My forthcoming calendar appointments even show up at the right hand side of my screen on my "To Do" bar. But when I try to switch screens to the calendar, the program simply freezes without any calendar information appearing. The "Calendar" button at the bottom right of the screen highlights in orange, without the highlighting disappearing on the "Mail" button (or "Cont...

Question re: TODAY or NOW functions
Hi, I use MS Office XP, and have set up a BOOK that has 2 worksheets, worksheet1 named 'checklist' contains a list of 60 establishments wh send data to me on a monthly basis (rows), with a column for each mont of the financial year. When i receive data for an establishment i tic the corresponding cell in 'checklist' with a tick (capital 'P webdings2). I have recently set up worksheet2 as 'Date Received' and have copie the table from checklist here. I want to make it so that as i enter tick in the checklist, 'date received' will automatically fill in th dat...

How do I leave the right margin open ended?
I am writing a paper, and for some reason, my right margin is set up so that all of the text ends in the same spot. I've never had this happen before. How to I get the document back to where the text is open ended in the right margin. I believe from your description your paragraph style is for Justified text, change the alignment to left. You probably hit Ctrl+J, which is the keyboard shortcut for Justified alignment. Press Ctrl+L for Left alignment. If this is not what you are asking, please reply with more details on how the rgiht margin can be "open ended". Ho...

Run time Error when running Z Report (-2147217900)(80040e14)
When I generate the report I get the initial filter screen, and when I click ok to view the report, I get the following error message: "The report could not be loaded due to the following error: (-2147217900) Cannot truncate table 'Cashier' because it is being refrenced by a FOREIGN KEY constraint. The table keys only seem to reference themselves, so check your table for integrity. If you don't know how to do that, try deleting the cashiers and reentering them. -Jerry -- -Jerry JR Data Inc. "Daniel" wrote: > When I generate the report I get the initi...

IE8 Add to Favorites
In IE8, when I want to add a site to My Favorites, when I go to select the folder to save it in, the list of all of my previously saves favorite folders completely opens up in expanded view. Since there are folders and multiple subfolders, is there a way to make only the half dozen or so main folders show up, then I could drill down and open each subfolder one at a time, instead of immediately seeing every single favorites folder I have ever created in a VERY long scrolling list? "M Skabialka" <mskabialka@NOSPAMdrc.com> wrote in message news:#nZS5pN$KHA....

Cannot run make-table query
When I run a make-table query in my Access 2003 database, I receive error: Record(s) cannot be read; no read permission on 'Measures'. Please note that I can open table Measures (linked) and edit, add, or delete data in table view, so I believe the message is misguided. While this may possibly be security related, it should not be. We had put this database through the security wizard, but when deployment did not work out, I did the following three things: 1. Gave Admin full rights on all objects. 2. Added Admin to the Admins group, which has full rights. 3. Gave the Users group f...