Re: Function and Syntax problems

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Re: Using excel through vbscript
    ... > Set wkbk = oxl.activeworkbook ... >> format the text file into different col. ... >> If I open file the way you told me It simply opens the text file but it does ... >>> The correct syntax would be ...
    (microsoft.public.excel.programming)
  • Re: Function and Syntax problems
    ... The reason the syntax is in the format it is, ... On the form's Open or Load event ... What I need is when the accompanying form opens have the ID field on ...
    (microsoft.public.access.forms)
  • Re: Removing password-protected
    ... by saving it as you said to the 2000-2003 format .mpp, however, a ... "JulieS" wrote: ... I've stepped through creating and removing passwords in MS ...
    (microsoft.public.project)
  • Re: Document not opening though Word is
    ... then it suggests "Rich Text Format ". ... I searched on some key words from the template and the content is in there, ... It should prompt you to indicate the file type. ... All produce the same result (Word opens, ...
    (microsoft.public.word.application.errors)
  • Re: open CSV.file
    ... "Dave Peterson" wrote: ... after this iam able to change the format manually in format ... below code but the file still opens in a US format. ... Dim TempWkbk As Workbook ...
    (microsoft.public.excel.programming)