Help with Event formatting?

  • Thread starter dohernan via AccessMonster.com
  • Start date
D

dohernan via AccessMonster.com

Hello, I have a form with a drop down combolist.
When Verification is chosen from it, I want to do an Event, AfterUpdate.

I want it to first see that "Verification" has been chosen, then for it to
check the current SSN against the SSNs in a 2nd AddressTable.

If there is no SSN match in the 2nd table I'll need a Subform to pop up and
take the address information, and then a Generate Letter/Report button can be
used, with all the extra info being saved to the 2nd table.

If there is a SSN match, that means the address is already in the 2nd table,
and a Report/Letter is to be opened in PrintView. However there needs to be
a way that the person can opt to open the Subform and change/add any
information to the Report/Letter.

I am unsure how to proceed. :/

I think the closest thing I have is -

Private Sub Verification_AfterUpdate()

If Me.[Verification] = "y" Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "VerificationLetter", acPreview, , _
"[Record] = " & Me.Record

End If

End Sub



Thanks
 
M

Mike Painter

What table(s) are involved in the first form?
What else aside form "verification" is available in the combo box?

You don't "pop" a subform, you open a form.
A subform is contaied ina mani form and from what little I see here there is
no reason why a single form would not suffice.
If the second table is joined to the first, then a combo could be used to
find the SSN and offer the option to add a new one if need be.
 
D

dohernan via AccessMonster.com

The first form is PersonnelForms2009 and it has a combolist that looks at 2
other tables, FormTypeList and tblOtherForms, there are like 15 choices, 1 of
which is Verifications.
The formtypes had to be split, the tblOtherforms are not done by me, they're
just a number given to me weekly. The other formtypes I track more in depth.

I've been mulling a Subform vs new Form for table 2, aka
VerificationLetterInformation.
Both Forms have a lot of fields.

Here's what I have so far now-
Private Sub FormType_AfterUpdate()

If Me.[FormType] = "Verification" Then
If Me.Dirty Then Me.Dirty = False
If IsNull(DLookup("SSN", "VerificationLetterInformation", "SSN = '" & Me.
SSN & "'")) Then
' The SSN doesn't exist in the second table. Do what you have to do...
Else
' The SSN exists in the second table.
' You could prompt them here if they want to open the other form.
End If
DoCmd.OpenReport "TemplateVerifLetter", acPreview, , _
"[Record] = " & Me.Record
End If

End Sub


Mike said:
What table(s) are involved in the first form?
What else aside form "verification" is available in the combo box?

You don't "pop" a subform, you open a form.
A subform is contaied ina mani form and from what little I see here there is
no reason why a single form would not suffice.
If the second table is joined to the first, then a combo could be used to
find the SSN and offer the option to add a new one if need be.
Hello, I have a form with a drop down combolist.
When Verification is chosen from it, I want to do an Event,
[quoted text clipped - 29 lines]
 
M

Mike Painter

I always try to use a query rather than dLookup or any other dSomething.
Used in a form teh difference will not be noticed but in most other things
it will be. Even printing seems to be slowed down by repeatd dSomethings.
I feel ther are valid reasons for doing this.

About the only time I open another form is when it is small. E.G. adding a
new person to a list. The small modal form will only collect as much info as
is needed for that particular use.
This is a just what I do and your needs may vary.

The first form is PersonnelForms2009 and it has a combolist that
looks at 2 other tables, FormTypeList and tblOtherForms, there are
like 15 choices, 1 of which is Verifications.
The formtypes had to be split, the tblOtherforms are not done by me,
they're just a number given to me weekly. The other formtypes I
track more in depth.

I've been mulling a Subform vs new Form for table 2, aka
VerificationLetterInformation.
Both Forms have a lot of fields.

Here's what I have so far now-
Private Sub FormType_AfterUpdate()

If Me.[FormType] = "Verification" Then
If Me.Dirty Then Me.Dirty = False
If IsNull(DLookup("SSN", "VerificationLetterInformation", "SSN =
'" & Me. SSN & "'")) Then
' The SSN doesn't exist in the second table. Do what you have to do...
Else
' The SSN exists in the second table.
' You could prompt them here if they want to open the other form.
End If
DoCmd.OpenReport "TemplateVerifLetter", acPreview, , _
"[Record] = " & Me.Record
End If

End Sub


Mike said:
What table(s) are involved in the first form?
What else aside form "verification" is available in the combo box?

You don't "pop" a subform, you open a form.
A subform is contaied ina mani form and from what little I see here
there is no reason why a single form would not suffice.
If the second table is joined to the first, then a combo could be
used to find the SSN and offer the option to add a new one if need
be.
Hello, I have a form with a drop down combolist.
When Verification is chosen from it, I want to do an Event,
[quoted text clipped - 29 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top