PC Review


Reply
Thread Tools Rate Thread

checking subform for records

 
 
johnlute
Guest
Posts: n/a
 
      9th Jul 2010
WinXP Office 2003

I use the following code in a database and it works fine. I'm trying
to use it in another database and it isn't working. Specifically, the
GoBackID isn't working. Instead of going back, the form navigates
away.

Does anyone see what needs changed to correct the problem?

Thanks in advance!

Private Function RequireChildRecord(Optional Unloading As Boolean)
Dim GoBackID As Variant
GoBackID = Null
Dim strMessage As String

If Len(LastRecordID & vbNullString) > 0 Then
If (LastRecordID <> Nz(Me.txtProfileID, 0)) Or Unloading Then
If DCount("*", "tblProfilesSensitivities", "txtProfileID='"
& LastRecordID & "'") = 0 Then
strMessage = vbCr & "Sensitivity information is
required!"
GoBackID = LastRecordID
Me.sfrmProfilesSensitivities.SetFocus
End If
End If
End If

If Len(LastRecordID & vbNullString) > 0 Then
If (LastRecordID <> Nz(Me.txtProfileID, 0)) Or Unloading Then
If DCount("*", "tblProfilesAllergens", "txtProfileID='" &
LastRecordID & "'") = 0 Then
strMessage = vbCr & "Allergen information is
required!"
GoBackID = LastRecordID
Me.sfrmProfilesAllergensRMING.SetFocus
End If
End If
End If

If Len(strMessage) > 0 Then
MsgBox Mid(strMessage, 2), vbCritical + vbOKOnly
End If

If Not IsNull(GoBackID) Then
If Unloading Then
DoCmd.CancelEvent
End If
Me.Recordset.FindFirst "txtProfileID='" & GoBackID
Else
LastRecordID = Me.txtProfileID
End If

End Function
 
Reply With Quote
 
 
 
 
johnlute
Guest
Posts: n/a
 
      12th Jul 2010
On Jul 10, 11:30*am, "Allen Browne" <AllenBro...@SeeSig.invalid>
wrote:
> Looks like you got answers to this q. in the MS forums, John


Hi, Allen. Yes, thanks. I can't get a read on what's going on relative
to the life/death of these forums so I posted it in both.
 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      13th Jul 2010
"johnlute" <(E-Mail Removed)> wrote in message
news:5296b201-8e0c-4336-91ec-(E-Mail Removed)...
On Jul 10, 11:30 am, "Allen Browne" <AllenBro...@SeeSig.invalid>
wrote:
>> Looks like you got answers to this q. in the MS forums, John

>
> Hi, Allen. Yes, thanks. I can't get a read on what's going on relative
> to the life/death of these forums so I posted it in both.


The microsoft.public.access.* forums haven't gone anywhere.

The change is that Microsoft is no longer maintaining their own server, but
many other ISPs are.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
Co-author: "Access 2010 Solutions", published by Wiley
(no e-mails, please!)




 
Reply With Quote
 
johnlute
Guest
Posts: n/a
 
      14th Jul 2010
On Jul 13, 5:42*pm, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_gmail.com> wrote:
> "johnlute" <jl...@marzetti.com> wrote in message
>
> news:5296b201-8e0c-4336-91ec-(E-Mail Removed)...
> On Jul 10, 11:30 am, "Allen Browne" <AllenBro...@SeeSig.invalid>
> wrote:
>
> >> Looks like you got answers to this q. in the MS forums, John

>
> > Hi, Allen. Yes, thanks. I can't get a read on what's going on relative
> > to the life/death of these forums so I posted it in both.

>
> The microsoft.public.access.* forums haven't gone anywhere.
>
> The change is that Microsoft is no longer maintaining their own server, but
> many other ISPs are.
>
> --
> Doug Steele, Microsoft Access MVPhttp://www.AccessMVP.com/djsteele
> Co-author: "Access 2010 Solutions", published by Wiley
> (no e-mails, please!)


Hi, Doug. Thanks for the clarification. It seems to me that these
Google Usenet groups appear to be withering - maybe I have the wrong
perception. I'm in the process of finding a new "home" but will
continue looking and posting here, too.
 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      14th Jul 2010
"johnlute" <(E-Mail Removed)> wrote in message
news:9136a961-cac9-4bf5-afed-(E-Mail Removed)...
>
> Hi, Doug. Thanks for the clarification. It seems to me that these
> Google Usenet groups appear to be withering - maybe I have the wrong
> perception. I'm in the process of finding a new "home" but will
> continue looking and posting here, too.


Since Microsoft has stopped providing their web interface to their
newsgroups, as well as shut down their free NNTP servers, the volume has
definitely dropped.

However, just to be clear, this is NOT a "Google Usenet group". Google
simply archives what's posted to the NNTP newsgroups (as well as providing
an interface to allow posting to the newsgroups)

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)



 
Reply With Quote
 
johnlute
Guest
Posts: n/a
 
      14th Jul 2010
> However, just to be clear, this is NOT a "Google Usenet group". Google
> simply archives what's posted to the NNTP newsgroups (as well as providing
> an interface to allow posting to the newsgroups)


True. I find it challenging however to suggest to people that they
should check out "the NNTP newsgroups archive via Google's interface"!
Most people find me sufficiently complicated and confusing without
adding more logs to that fire.
 
Reply With Quote
 
David W. Fenton
Guest
Posts: n/a
 
      16th Jul 2010
johnlute <(E-Mail Removed)> wrote in
news:6b2552cf-e100-4f75-a8c7-(E-Mail Removed)
:

> I find it challenging however to suggest to people that they
> should check out "the NNTP newsgroups archive via Google's
> interface"! Most people find me sufficiently complicated and
> confusing without adding more logs to that fire.


People find *me* confusing and complicated, too.

Not to mention annoying and tiresome.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 
Reply With Quote
 
johnlute
Guest
Posts: n/a
 
      16th Jul 2010
On Jul 15, 7:11*pm, "David W. Fenton" <XXXuse...@dfenton.com.invalid>
wrote:
> johnlute <jl...@marzetti.com> wrote innews:6b2552cf-e100-4f75-a8c7-(E-Mail Removed)
> :
>
> > I find it challenging however to suggest to people that they
> > should check out "the NNTP newsgroups archive via Google's
> > interface"! Most people find me sufficiently complicated and
> > confusing without adding more logs to that fire.

>
> People find *me* confusing and complicated, too.
>
> Not to mention annoying and tiresome.
>
> --
> David W. Fenton * * * * * * * * *http://www.dfenton.com/
> usenet at dfenton dot com * *http://www.dfenton.com/DFA/


See - I just knew we had something in common!
 
Reply With Quote
 
johnlute
Guest
Posts: n/a
 
      16th Jul 2010
On Jul 9, 1:15*pm, johnlute <jl...@marzetti.com> wrote:
> WinXP Office 2003
>
> I use the following code in a database and it works fine. I'm trying
> to use it in another database and it isn't working. Specifically, the
> GoBackID isn't working. Instead of going back, the form navigates
> away.
>
> Does anyone see what needs changed to correct the problem?
>
> Thanks in advance!
>
> Private Function RequireChildRecord(Optional Unloading As Boolean)
> * * Dim GoBackID As Variant
> * * GoBackID = Null
> * * Dim strMessage As String
>
> * * If Len(LastRecordID & vbNullString) > 0 Then
> * * * * If (LastRecordID <> Nz(Me.txtProfileID, 0)) Or Unloading Then
> * * * * * *If DCount("*", "tblProfilesSensitivities", "txtProfileID='"
> & LastRecordID & "'") = 0 Then
> * * * * * * * * strMessage = vbCr & "Sensitivity information is
> required!"
> * * * * * * * * GoBackID = LastRecordID
> * * * * * * * * Me.sfrmProfilesSensitivities.SetFocus
> * * * * * * End If
> * * * * End If
> * * End If
>
> * * If Len(LastRecordID & vbNullString) > 0 Then
> * * * * If (LastRecordID <> Nz(Me.txtProfileID, 0)) Or Unloading Then
> * * * * * *If DCount("*", "tblProfilesAllergens", "txtProfileID='" &
> LastRecordID & "'") = 0 Then
> * * * * * * * * strMessage = vbCr & "Allergen information is
> required!"
> * * * * * * * * GoBackID = LastRecordID
> * * * * * * * * Me.sfrmProfilesAllergensRMING.SetFocus
> * * * * * * End If
> * * * * End If
> * * End If
>
> * * * * * * If Len(strMessage) > 0 Then
> * * * * * * * * MsgBox Mid(strMessage, 2), vbCritical + vbOKOnly
> * * * * * * End If
>
> * * If Not IsNull(GoBackID) Then
> * * * * If Unloading Then
> * * * * * * DoCmd.CancelEvent
> * * * * End If
> * * * * Me.Recordset.FindFirst "txtProfileID='" & GoBackID
> * * Else
> * * * * LastRecordID = Me.txtProfileID
> * * End If
>
> End Function


BTW this was resolved (if anyone's interested). The line:
Me.Recordset.FindFirst "txtProfileID='" & GoBackID

needed changed to:
Me.Recordset.FindFirst "txtProfileID='" & GoBackID & "'"

DOH!!!
 
Reply With Quote
 
David W. Fenton
Guest
Posts: n/a
 
      16th Jul 2010
Marshall Barton <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> David W. Fenton wrote:
>>johnlute <(E-Mail Removed)> wrote
>>> I find it challenging however to suggest to people that they
>>> should check out "the NNTP newsgroups archive via Google's
>>> interface"! Most people find me sufficiently complicated and
>>> confusing without adding more logs to that fire.

>>
>>People find *me* confusing and complicated, too.
>>
>>Not to mention annoying and tiresome.

>
> Hey, David. you forgot to mention intelligent and
> extrordinaily knowledgable, but maybe that's part of being
> complicated ;-)


You're much kinder than my critics...thanks!

Truth be told, in real life, I can be difficult, but only about
things I care about. When I get bent out of shape about something in
Access, it's because it's something I care a lot about. Same in real
life -- nobody wastes energy on things toward which they are
indifferent.

BTW, an experienced salesperson once taught me the lesson when in
initial discussions with a potential new client that if they start
complaining about something, you've made the sale, as if they
weren't onboard, they wouldn't be motivated to bitch and moan.

It's a bit simplistic, but it is a viewpoint that makes it easier to
tolerate certain kinds of client reactions.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
subform combo to filter based on other subform...technically mainform's other subform records. nospam@thankyou.com Microsoft Access 0 15th Sep 2006 07:51 PM
prevent closing a form and go to subform if no records in subform??? tlyczko Microsoft Access Form Coding 4 17th Apr 2006 12:00 PM
Count Records in Subform to determine SubForm mode =?Utf-8?B?UmljaDEyMzQ=?= Microsoft Access Forms 3 6th Oct 2005 01:39 PM
checking subform for records? =?Utf-8?B?Q2hyaXM=?= Microsoft Access Form Coding 5 1st Jun 2005 12:09 AM
Urgent !!! - Values from Subform - #Error if no records in Subform and Only grabs first subform record Greg Microsoft Access Forms 0 17th Feb 2005 01:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.