VB error

  • Thread starter Thread starter Troy
  • Start date Start date
T

Troy

Hello,

Can someone please help me by telling me what was the designer's intensions
with the procedure shown below?
I'm getting an error 438 from VB stating that this method is not allowed.
The theory is that clicking on a name shown in List26 would update several
fields (name and address) in the same form.

Sub List26_AfterUpdate()
Me.RecordsetClone.FindFirst "[CarYardId] = " & Me![List26]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Thank you.
Troy
PS
Using ACC connected to SQL2k
 
This code does not do what you said. This code will make the record whose
[CarYarID]=[List26] to become the current record. It does not update
anything, just move records. To update, data there are other procedures to
use. I will need to know what data you ahve and what you are updating to
tell you what the correct procedure would be.

Kelvin
 
Thank you Kelvin,



Perhaps, update is not the right terminology to use but I checked once again
the form and what List26 does it brings up its information into adjacent
fields.

I copied this form into my own project because I liked its use but it is not
working as it is in the original project. This' why I'm asking to understand
its functionality so I can make it work for me.

TIA

Troy





Kelvin Lu said:
This code does not do what you said. This code will make the record whose
[CarYarID]=[List26] to become the current record. It does not update
anything, just move records. To update, data there are other procedures to
use. I will need to know what data you ahve and what you are updating to
tell you what the correct procedure would be.

Kelvin

Troy said:
Hello,

Can someone please help me by telling me what was the designer's intensions
with the procedure shown below?
I'm getting an error 438 from VB stating that this method is not allowed.
The theory is that clicking on a name shown in List26 would update several
fields (name and address) in the same form.

Sub List26_AfterUpdate()
Me.RecordsetClone.FindFirst "[CarYardId] = " & Me![List26]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Thank you.
Troy
PS
Using ACC connected to SQL2k
 
Thank you Kelvin,

Perhaps, update is not the right terminology to use but I checked once again
the form and what List26 does it brings up its information into adjacent
fields.

I copied this form into my own project because I liked its use but it is not
working as it is in the original project. This' why I'm asking to understand
its functionality so I can make it work for me.

TIA

Troy

Kelvin Lu said:
This code does not do what you said. This code will make the record whose
[CarYarID]=[List26] to become the current record. It does not update
anything, just move records. To update, data there are other procedures to
use. I will need to know what data you ahve and what you are updating to
tell you what the correct procedure would be.

Kelvin

Troy said:
Hello,

Can someone please help me by telling me what was the designer's intensions
with the procedure shown below?
I'm getting an error 438 from VB stating that this method is not allowed.
The theory is that clicking on a name shown in List26 would update several
fields (name and address) in the same form.

Sub List26_AfterUpdate()
Me.RecordsetClone.FindFirst "[CarYardId] = " & Me![List26]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Thank you.
Troy
PS
Using ACC connected to SQL2k
 
Sub List26_AfterUpdate()
Me.RecordsetClone.FindFirst "[CarYardId] = " & Me![List26]

RecordsetClone is a copy of the current set of records.
Findfirst is a search routine used to find a specific record in the set of
records. In this case, using the copy.

This line is searching a copy of the current records to find the one where
the field [CarYardID] equals the value in the field [List26] in the current
form.

Bookmark is the record number of the record currently shown on the form.
When the search was performed in the previous step, the current record for
the copy was set to the record with the matching data. This line then sets
the record that is shown in the form to match the record that was found in
the copy.

Thats it. All this does is move the record to the appropriate one. If you
look at the navigation bar at the bottom you will notice the record number
change from 10 of 100 (example) to 47 of 100 depending on which record
matches the search that was done.

Kelvin Lu
 
Back
Top