Excactly jump to the field being found.

F

Frank Situmorang

Hello,

Here is my VBA of combo in order to jump directly to the decision number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church board, the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the sub form
I have the field of Decesion NO ( No_Kep) and the “ Subject†and the
Decision. Subform format view is continues form…in order to accommodate so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only, but not
exactly bring me to the decision No.( No_Kep) itself. I have to scroll down
the scrollbar if the decision number is below or hidden by the footer of the
main form.

Can anyone help me how can we make it, even to highlight the decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 
A

Al Campagna

Frank,
Just add a GoToControl...
If Not rs.EOF Then Me.Bookmark = rs.Bookmark DoCmd.GoToControl "No_Kep"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Frank Situmorang said:
Hello,

Here is my VBA of combo in order to jump directly to the decision number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church board, the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the sub
form
I have the field of Decesion NO ( No_Kep) and the " Subject" and the
Decision. Subform format view is continues form.in order to accommodate so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only, but not
exactly bring me to the decision No.( No_Kep) itself. I have to scroll
down
the scrollbar if the decision number is below or hidden by the footer of
the
main form.

Can anyone help me how can we make it, even to highlight the decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 
F

Frank Situmorang

Thanks Al for your response. Could you help me again, when I run it, there is
a debugging error saying that the field name is not in the current record. Is
ist because the name field being searched is in the subform?linked with the
mainform by " ReportDate_ID"?

Here is my VBA after adding your suggestion.

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub

Thanks for your help again.

Frank

Al Campagna said:
Frank,
Just add a GoToControl...
If Not rs.EOF Then Me.Bookmark = rs.Bookmark DoCmd.GoToControl "No_Kep"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Frank Situmorang said:
Hello,

Here is my VBA of combo in order to jump directly to the decision number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church board, the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the sub
form
I have the field of Decesion NO ( No_Kep) and the " Subject" and the
Decision. Subform format view is continues form.in order to accommodate so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only, but not
exactly bring me to the decision No.( No_Kep) itself. I have to scroll
down
the scrollbar if the decision number is below or hidden by the footer of
the
main form.

Can anyone help me how can we make it, even to highlight the decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 
A

Al Campagna

Frank,
You did mention the subform MOM. I missed that...
Try...
DoCmd.GoToControl "MOM"
DoCmd.GoToControl "No_Kep"
Or try...
Forms!frmAddresses!frmAddressesTelephoneSub.SetFocus
DoCmd.GoToControl "No_Kep"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Frank Situmorang said:
Thanks Al for your response. Could you help me again, when I run it, there
is
a debugging error saying that the field name is not in the current record.
Is
ist because the name field being searched is in the subform?linked with
the
mainform by " ReportDate_ID"?

Here is my VBA after adding your suggestion.

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub

Thanks for your help again.

Frank

Al Campagna said:
Frank,
Just add a GoToControl...
If Not rs.EOF Then Me.Bookmark = rs.Bookmark DoCmd.GoToControl "No_Kep"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

Frank Situmorang said:
Hello,

Here is my VBA of combo in order to jump directly to the decision
number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church board,
the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of
Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the sub
form
I have the field of Decesion NO ( No_Kep) and the " Subject" and the
Decision. Subform format view is continues form.in order to accommodate
so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only, but
not
exactly bring me to the decision No.( No_Kep) itself. I have to scroll
down
the scrollbar if the decision number is below or hidden by the footer
of
the
main form.

Can anyone help me how can we make it, even to highlight the decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 
F

Frank Situmorang

Thanks Al for your quick response, but still not succesful or still debugging
saying the field named " MOm" is not in the current record.

Probably it can not go to it the reocord set, because it is linked with the
ReportdateID?

Thanks for your help.

Frank

Al Campagna said:
Frank,
You did mention the subform MOM. I missed that...
Try...
DoCmd.GoToControl "MOM"
DoCmd.GoToControl "No_Kep"
Or try...
Forms!frmAddresses!frmAddressesTelephoneSub.SetFocus
DoCmd.GoToControl "No_Kep"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Frank Situmorang said:
Thanks Al for your response. Could you help me again, when I run it, there
is
a debugging error saying that the field name is not in the current record.
Is
ist because the name field being searched is in the subform?linked with
the
mainform by " ReportDate_ID"?

Here is my VBA after adding your suggestion.

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub

Thanks for your help again.

Frank

Al Campagna said:
Frank,
Just add a GoToControl...
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

message Hello,

Here is my VBA of combo in order to jump directly to the decision
number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church board,
the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of
Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the sub
form
I have the field of Decesion NO ( No_Kep) and the " Subject" and the
Decision. Subform format view is continues form.in order to accommodate
so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only, but
not
exactly bring me to the decision No.( No_Kep) itself. I have to scroll
down
the scrollbar if the decision number is below or hidden by the footer
of
the
main form.

Can anyone help me how can we make it, even to highlight the decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 
A

Al Campagna

Frank,
Whenever you have problems with code, please include exactly
what code you used in your reply.
(Cut & Paste to insure an accurate "copy")

Are you selecting a value from a combo box on the main form...
that tries to find a particular record in a subform on that main form?

If so... I'd put the Combo20 in the Header section of your subform
itself, and use that to find a record, in the subform, by some unique value.
Your Combo20 would display all the No_Kep values associated with that
particular Main form value of [Meeting Date ID].

On my web site Tips (below) I have a sample 97 and 2000 file called
"Quick Find Combo". It demonstrates how to select a value from a combo, and
find that record with that value.
You might want to try that... it's very straight forward.
From "within" your subform... that would work like a champ.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Frank Situmorang said:
Thanks Al for your quick response, but still not succesful or still
debugging
saying the field named " MOm" is not in the current record.

Probably it can not go to it the reocord set, because it is linked with
the
ReportdateID?

Thanks for your help.

Frank

Al Campagna said:
Frank,
You did mention the subform MOM. I missed that...
Try...
DoCmd.GoToControl "MOM"
DoCmd.GoToControl "No_Kep"
Or try...
Forms!frmAddresses!frmAddressesTelephoneSub.SetFocus
DoCmd.GoToControl "No_Kep"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

Frank Situmorang said:
Thanks Al for your response. Could you help me again, when I run it,
there
is
a debugging error saying that the field name is not in the current
record.
Is
ist because the name field being searched is in the subform?linked with
the
mainform by " ReportDate_ID"?

Here is my VBA after adding your suggestion.

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub

Thanks for your help again.

Frank

:

Frank,
Just add a GoToControl...
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

in
message Hello,

Here is my VBA of combo in order to jump directly to the decision
number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church
board,
the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of
Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the
sub
form
I have the field of Decesion NO ( No_Kep) and the " Subject" and the
Decision. Subform format view is continues form.in order to
accommodate
so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only,
but
not
exactly bring me to the decision No.( No_Kep) itself. I have to
scroll
down
the scrollbar if the decision number is below or hidden by the
footer
of
the
main form.

Can anyone help me how can we make it, even to highlight the
decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 
A

Al Campagna

Frank,
Try...
Private Sub Combo20_AfterUpdate()
Me.MOM.SetFocus
DoCmd.GoToControl "No_Kep"
DoCmd.FindRecord Forms!frmMainFormName!Combo20
End Sub
-----------------------
I tested the following...
I have an address book form.
The main form is frmAddresses, and it has a sub form named
frmAddressesTelephoneSub
On that subform is a text control named TelNo.
Many TelNos to One Person or Business...

On the main form is a combo box named
cboFindTelNo
This cboTelNo is filtered to only show values associated with
that particular meeting. (are in the current subform recordset).
The code you see below allows me to select a telephone number from
the combo (on the main), and locate, and go to, the correct telephone
number in the TelNo subform control

Private Sub cboFindTelNo_AfterUpdate()
frmAddressesTelephoneSub.SetFocus
DoCmd.GoToControl "TelNo"
DoCmd.FindRecord Forms!frmAddresses!FindTelNo
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."



Private Functi
Frank Situmorang said:
Thanks Al for your quick response, but still not succesful or still
debugging
saying the field named " MOm" is not in the current record.

Probably it can not go to it the reocord set, because it is linked with
the
ReportdateID?

Thanks for your help.

Frank

Al Campagna said:
Frank,
You did mention the subform MOM. I missed that...
Try...
DoCmd.GoToControl "MOM"
DoCmd.GoToControl "No_Kep"
Or try...
Forms!frmAddresses!frmAddressesTelephoneSub.SetFocus
DoCmd.GoToControl "No_Kep"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

Frank Situmorang said:
Thanks Al for your response. Could you help me again, when I run it,
there
is
a debugging error saying that the field name is not in the current
record.
Is
ist because the name field being searched is in the subform?linked with
the
mainform by " ReportDate_ID"?

Here is my VBA after adding your suggestion.

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub

Thanks for your help again.

Frank

:

Frank,
Just add a GoToControl...
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

in
message Hello,

Here is my VBA of combo in order to jump directly to the decision
number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church
board,
the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of
Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the
sub
form
I have the field of Decesion NO ( No_Kep) and the " Subject" and the
Decision. Subform format view is continues form.in order to
accommodate
so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only,
but
not
exactly bring me to the decision No.( No_Kep) itself. I have to
scroll
down
the scrollbar if the decision number is below or hidden by the
footer
of
the
main form.

Can anyone help me how can we make it, even to highlight the
decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 
F

Frank Situmorang

Thanks Al.... after following your instruction, mine also works like a champ.

Frank

Al Campagna said:
Frank,
Try...
Private Sub Combo20_AfterUpdate()
Me.MOM.SetFocus
DoCmd.GoToControl "No_Kep"
DoCmd.FindRecord Forms!frmMainFormName!Combo20
End Sub
-----------------------
I tested the following...
I have an address book form.
The main form is frmAddresses, and it has a sub form named
frmAddressesTelephoneSub
On that subform is a text control named TelNo.
Many TelNos to One Person or Business...

On the main form is a combo box named
cboFindTelNo
This cboTelNo is filtered to only show values associated with
that particular meeting. (are in the current subform recordset).
The code you see below allows me to select a telephone number from
the combo (on the main), and locate, and go to, the correct telephone
number in the TelNo subform control

Private Sub cboFindTelNo_AfterUpdate()
frmAddressesTelephoneSub.SetFocus
DoCmd.GoToControl "TelNo"
DoCmd.FindRecord Forms!frmAddresses!FindTelNo
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."



Private Functi
Frank Situmorang said:
Thanks Al for your quick response, but still not succesful or still
debugging
saying the field named " MOm" is not in the current record.

Probably it can not go to it the reocord set, because it is linked with
the
ReportdateID?

Thanks for your help.

Frank

Al Campagna said:
Frank,
You did mention the subform MOM. I missed that...
Try...
DoCmd.GoToControl "MOM"
DoCmd.GoToControl "No_Kep"
Or try...
Forms!frmAddresses!frmAddressesTelephoneSub.SetFocus
DoCmd.GoToControl "No_Kep"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

message Thanks Al for your response. Could you help me again, when I run it,
there
is
a debugging error saying that the field name is not in the current
record.
Is
ist because the name field being searched is in the subform?linked with
the
mainform by " ReportDate_ID"?

Here is my VBA after adding your suggestion.

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub

Thanks for your help again.

Frank

:

Frank,
Just add a GoToControl...
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "No_Kep"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

in
message Hello,

Here is my VBA of combo in order to jump directly to the decision
number,
but let me explain first my forms structure,

I have the form of decision of Minutes of Meeting of our church
board,
the
field here is Meeting date
In the middle of this form I have the subform of MOM ( Minutes of
Meeting)
which is linked to the Meeting date Form by Meeting Date ID. In the
sub
form
I have the field of Decesion NO ( No_Kep) and the " Subject" and the
Decision. Subform format view is continues form.in order to
accommodate
so
many decision for one Meeting date.

Using the below VBA it works to bring me to the records set only,
but
not
exactly bring me to the decision No.( No_Kep) itself. I have to
scroll
down
the scrollbar if the decision number is below or hidden by the
footer
of
the
main form.

Can anyone help me how can we make it, even to highlight the
decision
number? ( No_ Kep) being jumped to.

Here is my VBA:

Private Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[No_KEP] = '" & Me![Combo20] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help

Frank
 

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