Re: Function and Syntax problems
- From: Confused <Confused@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Aug 2007 09:10:00 -0700
Carl,
The reason the syntax is in the format it is, because I was orginally
running this from a macro. I converted the marco to Visual and this was the
result. I want the ID to be passed from the main form to the form opened by
the selection in the combo box. My developers guide was stolen and I dont
currently get the proper formatting of the syntax for passing the ID. I do
believe I have to store it before it can be passed, right? This is where I
am stuck. I have not been do this very long so this is a new undertaking for
me. The Me.ID is where the ID is stored? On the form's Open or Load event
would have additional syntax? Any assistance is always appreciated.
Bob
"Carl Rapson" wrote:
"Confused" <Confused@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message.
news:3C3546B3-073E-4C78-BEC2-BB9517DDAA38@xxxxxxxxxxxxxxxx
I need assistance with the proper syntax for auto-filling the id field on
one
form coming from the id field of another form. I believe the function I
need
to use is Dlast. Here is the situation. I have several tables which are
all
related on the ID field. In the TblIssues (My main table) the ID field is
an
autonumber. All my tables have separate forms created. The FrmIssues
(the
main form) has a combo box which depending on the selection will open the
appropriate accompanying form. The coding is as follows:
Private Sub Combo22_Change()
DoCmd.RunCommand acCmdSaveRecord
If (Forms!FrmIssues!Combo22 = "Ordering") Then
DoCmd.OpenForm "FrmOrder", acNormal, "", "", , acNormal
End If
If (Forms!FrmIssues!Combo22 = "Service Call") Then
DoCmd.OpenForm "FrmServiceCall", acNormal, "", "", , acNormal
End If
End Sub
What I need is when the accompanying form opens have the ID field on the
form populate automatically with the record ID from the main form so the
new
records will be linked.
Any help is greatly appreciated!
Why do you have 'acNormal' in the OpenArgs parameter in your OpenForm calls?
If the main for is already positioned on the record whose ID you want, you
could just pass the ID value in the OpenArgs parameter of OpenForm, and then
pick it up in the next form's Open or Load event:
DoCmd.OpenForm "FrmOrder", acNormal, , , , Me.ID
Carl Rapson
- Follow-Ups:
- Re: Function and Syntax problems
- From: Carl Rapson
- Re: Function and Syntax problems
- References:
- Re: Function and Syntax problems
- From: Carl Rapson
- Re: Function and Syntax problems
- Prev by Date: Re: Auto Fill a Textbox in Form
- Next by Date: Re: Auto Fill a Textbox in Form
- Previous by thread: Re: Function and Syntax problems
- Next by thread: Re: Function and Syntax problems
- Index(es):
Relevant Pages
|