Find A Date Value In A Subform From Another Subform's Date Field Value

  • Thread starter Thread starter Bill (Unique as my name)
  • Start date Start date
B

Bill (Unique as my name)

Sorry to be such a beggar, but I'm still learning VBA. The more I
see what I can do with it, the more ambitious I get. Here is my
difficulty.

First, I'm just plain stupid.

Second, I have two separate subforms on the same main form. After I
update the date field, "ureturned" in one subform, I want to find
that date in the other subform in the date field, "Hillary".
I've written the code for what I'm going to do after, but I can't
seen to get to that point.

Thank you for all the previous help. You were most gracious, but
please sir, may I have more?
 
Hi Bill

MORE???????? <g>

The code is very similar to what Marsh has already given you, except that
instead of dealing with a subform on the form where your code is running,
the subform is on the *parent* of the current form.

The reference can get a bit complex, so to avoid repetitions, declare a Form
object variable:

Dim sbf as Form
Set sbf = Me.Parent![NameOfSecondSubformControl].Form
With sbf.RecordsetClone
If .RecordCount > 0 Then
.FindFirst "Hillary = " & Format(ureturned, "\#mm\/dd\/yyyy\#")
If Not .NoMatch Then
sbf.Bookmark = .Bookmark
End If
End If
End With
 
Amazing! This is just so AMAZING! Thank you, Graham!


Graham said:
Hi Bill

MORE???????? <g>

The code is very similar to what Marsh has already given you, except that
instead of dealing with a subform on the form where your code is running,
the subform is on the *parent* of the current form.

The reference can get a bit complex, so to avoid repetitions, declare a Form
object variable:

Dim sbf as Form
Set sbf = Me.Parent![NameOfSecondSubformControl].Form
With sbf.RecordsetClone
If .RecordCount > 0 Then
.FindFirst "Hillary = " & Format(ureturned, "\#mm\/dd\/yyyy\#")
If Not .NoMatch Then
sbf.Bookmark = .Bookmark
End If
End If
End With
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Bill (Unique as my name) said:
Sorry to be such a beggar, but I'm still learning VBA. The more I
see what I can do with it, the more ambitious I get. Here is my
difficulty.

First, I'm just plain stupid.

Second, I have two separate subforms on the same main form. After I
update the date field, "ureturned" in one subform, I want to find
that date in the other subform in the date field, "Hillary".
I've written the code for what I'm going to do after, but I can't
seen to get to that point.

Thank you for all the previous help. You were most gracious, but
please sir, may I have more?
 
Bill said:
I have two separate subforms on the same main form. After I
update the date field, "ureturned" in one subform, I want to find
that date in the other subform in the date field, "Hillary".
I've written the code for what I'm going to do after, but I can't
seen to get to that point.


The code is the same as we used in Jakes AfterUpdate event,
except you need to use Parent. in fornt of Arleen and change
Jake to UReturned.

There is definitely a pattern to this kind of thing so you
might want to think about how to generalize it to any
situation. Hint:
http://www.mvps.org/access/forms/frm0031.htm
 
Can you recommend any good books on the subject?
Thanks again, Marshall!
 
A book on which subject?? Access is a humongous topic where
people write books about just parts of it ;-)

There's probably a few years worth of studying in The Access
xx Developer's Handbook by Getz, Litwin and Gunderloy from
SYBEX (where xx is the version of Access). My 2002 edition
is only 3000+ pages in 2 volumes (the desktop volume is
probaly all you'll need for quite a while). This is not a
beginners book, but is generally considered to be one of the
most complete and one that no serious developer of Access
applications should be without.

I also recommend John Viescas' Access 2003 Inside Out, which
includes several complets applications that demonstrate the
topices discussed in the book.

There are several others that are very good, for a couple of
them see Arvin's reply in a thread with this same question
about an hour and a half before you started this thread.

There are also numerous web sites about Access. Be sure to
start with The Access Web at http://www.mvps.org/access/
And before your head explodes with all that information,
check the Resources page that has links to many related
sites.

You should also become familiar with searching the Microsoft
Knowledge Base starting from
http://support.microsoft.com/default.aspx?scid=fh;rid;kbinfo

If you haven't already done so by now, you will want to
create a Favorites folder just for Access stuff.

And don't forget, Google is your friend. It can also search
through 10+ years worth of all the questions and answers in
all the various Access newsgroups. This is a good thing to
do before you post what you think is a new problem in using
Access ;-))
 
Looks like cake walk.

I've searched through the usenet for various topics since around 1990,
and found lots. It's a great resource, and its value is due primarily
to generous contributions of professionals like yourself. Every
experience I've had with Microsoft's MVP's has been abundantly fruitful
and very enjoyable. Thank you for contributing. It's almost like
tapping directly into great minds around the world.


Marshall said:
A book on which subject?? Access is a humongous topic where
people write books about just parts of it ;-)

There's probably a few years worth of studying in The Access
xx Developer's Handbook by Getz, Litwin and Gunderloy from
SYBEX (where xx is the version of Access). My 2002 edition
is only 3000+ pages in 2 volumes (the desktop volume is
probaly all you'll need for quite a while). This is not a
beginners book, but is generally considered to be one of the
most complete and one that no serious developer of Access
applications should be without.

I also recommend John Viescas' Access 2003 Inside Out, which
includes several complets applications that demonstrate the
topices discussed in the book.

There are several others that are very good, for a couple of
them see Arvin's reply in a thread with this same question
about an hour and a half before you started this thread.

There are also numerous web sites about Access. Be sure to
start with The Access Web at http://www.mvps.org/access/
And before your head explodes with all that information,
check the Resources page that has links to many related
sites.

You should also become familiar with searching the Microsoft
Knowledge Base starting from
http://support.microsoft.com/default.aspx?scid=fh;rid;kbinfo

If you haven't already done so by now, you will want to
create a Favorites folder just for Access stuff.

And don't forget, Google is your friend. It can also search
through 10+ years worth of all the questions and answers in
all the various Access newsgroups. This is a good thing to
do before you post what you think is a new problem in using
Access ;-))
--
Marsh
MVP [MS Access]

Can you recommend any good books on the subject?
Thanks again, Marshall!
 
My goodness, Bill, that's about the most gracious "Thanks"
I've ever seen. I really appreciate it and have passed it
on to the other Access MVPs.
--
Marsh
MVP [MS Access]

Looks like cake walk.

I've searched through the usenet for various topics since around 1990,
and found lots. It's a great resource, and its value is due primarily
to generous contributions of professionals like yourself. Every
experience I've had with Microsoft's MVP's has been abundantly fruitful
and very enjoyable. Thank you for contributing. It's almost like
tapping directly into great minds around the world.


Marshall said:
A book on which subject?? Access is a humongous topic where
people write books about just parts of it ;-)

There's probably a few years worth of studying in The Access
xx Developer's Handbook by Getz, Litwin and Gunderloy from
SYBEX (where xx is the version of Access). My 2002 edition
is only 3000+ pages in 2 volumes (the desktop volume is
probaly all you'll need for quite a while). This is not a
beginners book, but is generally considered to be one of the
most complete and one that no serious developer of Access
applications should be without.

I also recommend John Viescas' Access 2003 Inside Out, which
includes several complets applications that demonstrate the
topices discussed in the book.

There are several others that are very good, for a couple of
them see Arvin's reply in a thread with this same question
about an hour and a half before you started this thread.

There are also numerous web sites about Access. Be sure to
start with The Access Web at http://www.mvps.org/access/
And before your head explodes with all that information,
check the Resources page that has links to many related
sites.

You should also become familiar with searching the Microsoft
Knowledge Base starting from
http://support.microsoft.com/default.aspx?scid=fh;rid;kbinfo

If you haven't already done so by now, you will want to
create a Favorites folder just for Access stuff.

And don't forget, Google is your friend. It can also search
through 10+ years worth of all the questions and answers in
all the various Access newsgroups. This is a good thing to
do before you post what you think is a new problem in using
Access ;-))
--
Marsh
MVP [MS Access]

Can you recommend any good books on the subject?
Thanks again, Marshall!

Marshall Barton wrote:
Bill (Unique as my name) wrote:
I have two separate subforms on the same main form. After I
update the date field, "ureturned" in one subform, I want to find
that date in the other subform in the date field, "Hillary".
I've written the code for what I'm going to do after, but I can't
seen to get to that point.


The code is the same as we used in Jakes AfterUpdate event,
except you need to use Parent. in fornt of Arleen and change
Jake to UReturned.

There is definitely a pattern to this kind of thing so you
might want to think about how to generalize it to any
situation. Hint:
http://www.mvps.org/access/forms/frm0031.htm
 

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

Back
Top