Me.Requery & DAO.Recordset

W

William

I searched for a replacement of the "Me.Requery" function
and came across the function that was posted in a thread
some time ago (problem is that I don't want to move back
to first record after refreshing a form).

After integrating the function, I performed some initial
analysis.

The function really works well, except that I am having
problems with the first record of the recordset. Once I
make changes on the first record, it some locks up other
text fields.

Does anyone know what the issue might be and how I can
work around this? How can I ensure that the first record
will be handled differently than all other records of the
record set?

Regards,
William


Dim rs As DAO.Recordset
Dim lngID As Long

With Me
lngID = .AutoNumberFieldName
.Requery
DoEvents
Set rs = .RecordsetClone
rs.FindFirst "[AutoNumberFieldName] = " & lngID
If rs.NoMatch = False Then
.Bookmark = rs.Bookmark
End If
End With
 
L

Larry Linson

I don't understand what you mean by "Once I make changes on the first
record, it some locks up other text fields." so it would be difficult to
respond. Please clarify here in the newsgroup, not by e-mail. Thanks.

Larry Linson
Microsoft Access MVP
 
W

William

Larry, thanks for your reply.

After I run an update (INSERT into another table), the
form should reflect the changes immediately in the
subform (which it does for all records except the first
one).

I also can make changes to all other textboxes (e.g.
change state from TX to VA) as long as I am not on,
again, the first record.

If I would try to perform the same steps on record no 1,
I can make one update (insert to table) and one
modification to the e.g. STATE text box... once the
change was made in the STATE text box, it is frozen.

The, if I were to close the window, I am prompted that
the changes cannot be saved.

Does this help? Please let me know if you have any
other suggestions that will allow me to use the
DAO.recordset function for all records >1 and the
Me.Requery for record no 1.

Thanks,
William


William
-----Original Message-----
I don't understand what you mean by "Once I make changes on the first
record, it some locks up other text fields." so it would be difficult to
respond. Please clarify here in the newsgroup, not by e- mail. Thanks.

Larry Linson
Microsoft Access MVP

I searched for a replacement of the "Me.Requery" function
and came across the function that was posted in a thread
some time ago (problem is that I don't want to move back
to first record after refreshing a form).

After integrating the function, I performed some initial
analysis.

The function really works well, except that I am having
problems with the first record of the recordset. Once I
make changes on the first record, it some locks up other
text fields.

Does anyone know what the issue might be and how I can
work around this? How can I ensure that the first record
will be handled differently than all other records of the
record set?

Regards,
William


Dim rs As DAO.Recordset
Dim lngID As Long

With Me
lngID = .AutoNumberFieldName
.Requery
DoEvents
Set rs = .RecordsetClone
rs.FindFirst "[AutoNumberFieldName] = " & lngID
If rs.NoMatch = False Then
.Bookmark = rs.Bookmark
End If
End With


.
 
L

Larry Linson

Looks to me as if the code you have locates to the appropriate Record, and
should be used after the Requery. Is that what you were doing? With proper
referencing, you can run it outside the Form that is embedded in the
Subform.

Larry Linson
Microsoft Access MVP

William said:
Larry, thanks for your reply.

After I run an update (INSERT into another table), the
form should reflect the changes immediately in the
subform (which it does for all records except the first
one).

I also can make changes to all other textboxes (e.g.
change state from TX to VA) as long as I am not on,
again, the first record.

If I would try to perform the same steps on record no 1,
I can make one update (insert to table) and one
modification to the e.g. STATE text box... once the
change was made in the STATE text box, it is frozen.

The, if I were to close the window, I am prompted that
the changes cannot be saved.

Does this help? Please let me know if you have any
other suggestions that will allow me to use the
DAO.recordset function for all records >1 and the
Me.Requery for record no 1.

Thanks,
William


William
-----Original Message-----
I don't understand what you mean by "Once I make changes on the first
record, it some locks up other text fields." so it would be difficult to
respond. Please clarify here in the newsgroup, not by e- mail. Thanks.

Larry Linson
Microsoft Access MVP

I searched for a replacement of the "Me.Requery" function
and came across the function that was posted in a thread
some time ago (problem is that I don't want to move back
to first record after refreshing a form).

After integrating the function, I performed some initial
analysis.

The function really works well, except that I am having
problems with the first record of the recordset. Once I
make changes on the first record, it some locks up other
text fields.

Does anyone know what the issue might be and how I can
work around this? How can I ensure that the first record
will be handled differently than all other records of the
record set?

Regards,
William


Dim rs As DAO.Recordset
Dim lngID As Long

With Me
lngID = .AutoNumberFieldName
.Requery
DoEvents
Set rs = .RecordsetClone
rs.FindFirst "[AutoNumberFieldName] = " & lngID
If rs.NoMatch = False Then
.Bookmark = rs.Bookmark
End If
End With


.
 
W

William

Larry:

I am completely lost now... do you mind providing me
additional pointers as to where I should place the place
or how I should modify it.

William

-----Original Message-----
Looks to me as if the code you have locates to the appropriate Record, and
should be used after the Requery. Is that what you were doing? With proper
referencing, you can run it outside the Form that is embedded in the
Subform.

Larry Linson
Microsoft Access MVP

Larry, thanks for your reply.

After I run an update (INSERT into another table), the
form should reflect the changes immediately in the
subform (which it does for all records except the first
one).

I also can make changes to all other textboxes (e.g.
change state from TX to VA) as long as I am not on,
again, the first record.

If I would try to perform the same steps on record no 1,
I can make one update (insert to table) and one
modification to the e.g. STATE text box... once the
change was made in the STATE text box, it is frozen.

The, if I were to close the window, I am prompted that
the changes cannot be saved.

Does this help? Please let me know if you have any
other suggestions that will allow me to use the
DAO.recordset function for all records >1 and the
Me.Requery for record no 1.

Thanks,
William


William
-----Original Message-----
I don't understand what you mean by "Once I make
changes
on the first
record, it some locks up other text fields." so it
would
be difficult to
respond. Please clarify here in the newsgroup, not by
e-
mail. Thanks.
Larry Linson
Microsoft Access MVP

I searched for a replacement of the "Me.Requery" function
and came across the function that was posted in a thread
some time ago (problem is that I don't want to move back
to first record after refreshing a form).

After integrating the function, I performed some initial
analysis.

The function really works well, except that I am having
problems with the first record of the recordset. Once I
make changes on the first record, it some locks up other
text fields.

Does anyone know what the issue might be and how I can
work around this? How can I ensure that the first record
will be handled differently than all other records
of
the
record set?

Regards,
William


Dim rs As DAO.Recordset
Dim lngID As Long

With Me
lngID = .AutoNumberFieldName
.Requery
DoEvents
Set rs = .RecordsetClone
rs.FindFirst "[AutoNumberFieldName] = " & lngID
If rs.NoMatch = False Then
.Bookmark = rs.Bookmark
End If
End With



.


.
 

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

Similar Threads


Top