473,799 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confused about docmd.openform

formA determines some_where and some_value and issues

docmd.close ,Me
docmd.openform "formB", , ,some_where, , ,some_value

formB receives the correct some_where and some_value
After completing its work formB issues

docmd.close ,Me
docmd.openform "formA"

formA determines a new some_where and some_value and again issues

docmd.close ,Me
docmd.openform "formB", , ,some_where, , ,some_value

formB receives the correct some_where but no update of some_value

I also note that the forms' OnOpen event-code executes only the first
time that the forms are opened. How do I pass a new OpenArgs value to
formB after the first time?

I'm suspicious about where I've placed the close statements, but
neither order makes sense to me: if I close the form first, how does
the closed form execute the open statement that comes after the close
statement? ...but if I open the next form first, haven't I left the
environment where the close statement exists? And if my open
statements are failing, then why is *part* of the open statement
executing correctly [the some_where]?

--thelma
rephrasing an unanswered question

Nov 13 '05
15 3901
Larry Linson <bo*****@localh ost.not> wrote:
: "Thelma Lubkin" wrote

: > Public AgcID, EmpKey As Long
: > Dim AgcCol, PCnt As Integer
: > Dim GString As String

: Thelma, unless you are aware that AgcID and AgcCol are defined here as
: Variants, you could be in for some surprises sometime.

Thank you. I, indeed, didn't know that. Can you recommend a
book for someone who prefers code to wizards but who isn't
so dedicated as to want to write the class for each button
from scratch. The few books I've seen seem to assume one or the
other of the two extreme positions.
--thelma
: Larry Linson
: Microsoft Access MVP
Nov 13 '05 #11
The book that almost every experienced Access developer of my acquaintance
has and swears by (not at) is the "Access Developer's Handbook" by Litwin,
Getz, et al. There's an edition for every version of Access _except_ V 1
(developer stuff was kinda primitive) and 2003 (not much change from 2002).

Getz et al have also done a book just on VBA, but it is not particularly
Access-oriented. I didn't find it very useful, as I do little or no VBA for
Excel, Word, etc.

I used to recommend Dr. Rick Dobson's, "Programmin g Access <version>" for
people moving from power user to developer, but now I suggest you browse it,
too. It strongly emphasizes ADO, which knowledgeable Microsoft insiders no
longer recommend, and the Access ADP client to SQL Server. He writes well,
and is a good teacher, but the subjects may not be what you are looking for.
The Access 2000 version may be more useful than later ones.

Another book I like is "Access 2003 Inside Out" by John Viescas, from
Microsoft Press. Better browse it at your local bookstore, though, to see if
it has enough VBA.

There are book recommendations at the FAQ, http://www.mvps.org/access, too,
from knowledgeable Access folks.

Larry Linson
Microsoft Access MVP
"Thelma Lubkin" <th****@alpha2. csd.uwm.edu> wrote in message
news:da******** **@uwm.edu...
Larry Linson <bo*****@localh ost.not> wrote:
: "Thelma Lubkin" wrote

: > Public AgcID, EmpKey As Long
: > Dim AgcCol, PCnt As Integer
: > Dim GString As String

: Thelma, unless you are aware that AgcID and AgcCol are defined here as
: Variants, you could be in for some surprises sometime.

Thank you. I, indeed, didn't know that. Can you recommend a
book for someone who prefers code to wizards but who isn't
so dedicated as to want to write the class for each button
from scratch. The few books I've seen seem to assume one or the
other of the two extreme positions.
--thelma
: Larry Linson
: Microsoft Access MVP

Nov 13 '05 #12
Larry Linson <bo*****@localh ost.not> wrote:
: The book that almost every experienced Access developer of my acquaintance
: has and swears by (not at) is the "Access Developer's Handbook" by Litwin,
: Getz, et al. There's an edition for every version of Access _except_ V 1
: (developer stuff was kinda primitive) and 2003 (not much change from 2002).

: Getz et al have also done a book just on VBA, but it is not particularly
: Access-oriented. I didn't find it very useful, as I do little or no VBA for
: Excel, Word, etc.

: I used to recommend Dr. Rick Dobson's, "Programmin g Access <version>" for
: people moving from power user to developer, but now I suggest you browse it,
: too. It strongly emphasizes ADO, which knowledgeable Microsoft insiders no
: longer recommend, and the Access ADP client to SQL Server. He writes well,
: and is a good teacher, but the subjects may not be what you are looking for.
: The Access 2000 version may be more useful than later ones.

: Another book I like is "Access 2003 Inside Out" by John Viescas, from
: Microsoft Press. Better browse it at your local bookstore, though, to see if
: it has enough VBA.

: There are book recommendations at the FAQ, http://www.mvps.org/access, too,
: from knowledgeable Access folks.

Thank you. I'll look for these.
--thelma

: Larry Linson
: Microsoft Access MVP
Nov 13 '05 #13
rkc <rk*@rochester. yabba.dabba.do. rr.bomb> wrote:
: Thelma Lubkin wrote:

: <snip all>

: I do not see any reason to do battle with the simple way that
: Access provides to do what you want to do.

: Open the Agency form to a specific agency using:

: strfilter = "agencyid = " & AgcID
: DoCmd.OpenForm DoCmd.OpenForm "agency0toD ", _
: acNormal, , strFilter, _
: acFormReadOnly, acWindowNormal, _
: empID
: DoCmd.Close , "frmChooseAgenc y"

: In that order.
: Call that from the combo box OnClick event.

: Return to frmChooseAgency from the agency form using:

: DoCmd.OpenForm "frmChooseAgenc y"
: DoCmd.Close acForm, Me.Name

: Check for a valid empId in openArgs in the agency form's
: OnLoad Event. If one is found do your subform navigation
: by calling a sub routine defined in the subform's code
: module.
Thanks very much to all of you who helped me to write my
first vba form [ie my first experience of the environment
altogether] Thank you:

Arno R, Bas Coste Budde, dreadnought, Larry Linson, rkc,
Tom Stiphout, Wayne Morgan. I'm sorry if I've forgotten anyone.

It works about the way I want it to now. My major stumbling
blocks were using a toggle where I needed only a simple command
button, and misunderstandin g bookmarks so that I was trying to set a
parent-form's bookmark to that of its child.

--thelma
Nov 13 '05 #14
In a previous message you state:
I used to recommend Dr. Rick Dobson's, "Programmin g Access <version>" for
people moving from power user to developer, but now I suggest you browse
it,
too. It strongly emphasizes ADO, which knowledgeable Microsoft insiders no
longer recommend, and the Access ADP client to SQL Server. He writes well,
and is a good teacher, but the subjects may not be what you are looking
for.
The Access 2000 version may be more useful than later ones.


Can you expand on your statement about ADO and what is currently
recommended.
I am working through Dr. Dobson's "Programmin g Access 2003...".

Thanks
Nov 13 '05 #15
In a previous message you state:
I used to recommend Dr. Rick Dobson's, "Programmin g Access <version>" for
people moving from power user to developer, but now I suggest you browse
it,
too. It strongly emphasizes ADO, which knowledgeable Microsoft insiders no
longer recommend, and the Access ADP client to SQL Server. He writes well,
and is a good teacher, but the subjects may not be what you are looking
for.
The Access 2000 version may be more useful than later ones.


Can you expand on your statement about ADO and what is currently
recommended.
I am working through Dr. Dobson's "Programmin g Access 2003...".

Thanks
Nov 13 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3993
by: Aravind | last post by:
Hi folks. I have 2 forms, frmMain and frmHistory. frmHistory has a field called Return. frmMain has a command button called "Due Today" (which will henceforth be called as DT), which opens frmHistory and filters it to display records where the value of Return is Null
6
4200
by: beowulfs | last post by:
Here's what I've got: I've got a form with combo boxes. you can select already existing company names or type in new ones. if you type in a new one, it prompts you to double click the combo box if you want to add a new company. when you double click it brings up the new company form so you can enter the rest of the information besides just the name there. This all works. Here's what I want:
3
4521
by: Lyn | last post by:
Hi, I have a Search input form which collects from the user a person's name. I am using LIKE with a "%" suffix in the SQL so that the user does not have to type in the full name. When they hit the Search button, a query is run to search the Person table for a match. This produces a recordset (I am using ADO). If the RecordCount is zero, they get a No Match message. If the RecordCount is 1, a DoCmd.OpenForm is performed to open the...
8
13215
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but shows all records, rather than going to the one I want. If I look at the form in design view, it shows 'SearchAssignmentID=1' (without quotes) as the filter in the properties list. frmSearchAssignments is bound to a query qrySearchAssignments....
2
6870
by: Mike | last post by:
I am trying to open a search results form based on the input from a prompt form. I am using the following code: --- Begin Code --- Private Sub btnSearch_Click() 'Dim Variable and assign data Dim srce As String, fstnme As String, lstnme As String, bidnum As String srce = Me.Source_Control If Not IsNull(Me.Text18) Then
9
3524
by: keliie | last post by:
Hello (from Access novice), I'm building a switchboard form (using a Treeview object). The treeview is populated by two tables (tblSwitchboardParent and tblSwitchboardChild). Within tblSwitchboardChild, I have a string field called ChildArgument that contains string text of VBA code (e.g., DoCmd.OpenForm "myForm"). When users click on various portions of the Treeview object I want the Tree to either expand or open the report / form.
2
387
by: rturpyn | last post by:
I want to simply open a form, I don't want to limit the records returned. I'm using the code.... DoCmd.OpenForm "frm_GSG_Access_Rights", acFormDS, , When I enter something in the where ("Elist_Caption = 'GSG Model'") it does return my form with only 1 record. What am I missing? Thanks, -Turp
1
2722
by: silen | last post by:
i am using Access2000. Currently i had a main form call "frmDownload" and sub form "fsubAdmmission". Under the fsubAdmmission, i do have another sub form "fsubHospital". Once i link my application to database A, when "frmDownload" loaded, it does successfully create "fsubAdmmission" object and i am able to assign "fsubAdmmission.form.recordsource". Once i link my application to database B, when "frmDownload" loaded, it failed to assign...
5
4320
by: Lebbsy | last post by:
After displaying search results, I want to be able to double click the identity number field and then the input form SubmissionDetails becomes the display form for the results of the data matching value of the selected identity number. With my code below I get a data type mismatch error. Please help me....... Private Sub IdentityNumber_Click() On Error GoTo IdentityNumber_Click_Err On Error Resume Next If (Form.Dirty) Then ...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.