seek-problem


Author
Message
Thomas Holste
Thomas Holste
Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)Advanced StrataFrame User (536 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

in a form I want to use as a lookup-form I have a problem with the seek-method, which does not seem to work.

On the form, the BO "LieferöookupBO' is filled in the parentformloading-event.

The calling form, which activates the lookup-form, send a search-parameter, which is

assigned to a private form-var. In the Load-Event I tried my seek-implementation:



If cSuche.Length > 0 Then

Dim lRet As Boolean

MsgBox("Count: " & LieferBO1.Count.ToString)  ' Just testing, if the BO is filled. It is.

lRet = LieferLookupBo.Seek(
"adresse='CLA'")   ' Hardcoded just fpr testing purposes.

If lRet Then

MsgBox("Found: " & LieferBO1.ADRESSE) ' Has not moved the current row index, not showing "CLA"

Else

MsgBox("Nothing")

End If



The search happens on a table containing lookup-codes like:

ASAP

AVA

BM

CLA

Now what happens is, that seek returns True, as if if has found "CLA" but the current row index has not changed (as described in the help-file) as the "ADRESSE"-property of the BO is showing the first code in the table "ASAP".

Can anybody tell me. what is going wrong there.

Best regards

Thomas
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
There is something else in your form moving the row back to another position.

Try this.  Instead of doing all of this in a form load.  Override the OnLoad event of the form.  This is safer anyway.  You can still call the base logic, then place your coder after the base code.  At this point, most of the core logic will have been executed.  Another option, is to just create a button on the form, temporarily, that executes your code.  This will prove is something else is moving the row pointer as part of a load-up process.

It seems like there is a navigate going on elsewhere that is positioning the record.  This could happen if you are placing this code to early in the load (prior to core form logic) and there is data binding in place that is binding to the same BO instance that you are working with.

A seek doesn't update the binding where a navigate does.  Also, be sure to check your code to make sure that there isn't something else in your form that accesses the same instance of the BO and moves the record pointer.

Just FYI, the seek is a very straight forward process, so move your code downstream on the loading sequence to see if you can get the results that you are looking for and then you can work backwards from there.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Thomas Holste - 13 Years Ago
Trent L. Taylor - 13 Years Ago
Edhy Rijo - 13 Years Ago
Trent L. Taylor - 13 Years Ago
Thomas Holste - 13 Years Ago
                     Hi Thomas, You are welcome!!! [quote][b]Thomas Holste...
Edhy Rijo - 13 Years Ago
                         Hi Edhy, I wonder if I have understood the conceot of the...
Thomas Holste - 13 Years Ago
                             You can still call it from many different places. There is a BO that...
Trent L. Taylor - 13 Years Ago
                             Hi Thomas, [quote][b]Thomas Holste (8/17/2012)[/b][hr]I wonder if I...
Edhy Rijo - 13 Years Ago
                                 Hi Edhy, thanks for your explanations. I dio something similar with...
Thomas Holste - 13 Years Ago
                                     Hi Thomas, [quote][b]Thomas Holste (8/22/2012)[/b][hr]...so I don't...
Edhy Rijo - 13 Years Ago
                                         Hi Edhy, <<have cases where I used the ChildFormDialog with no...
Thomas Holste - 13 Years Ago
Trent L. Taylor - 13 Years Ago
                         Hi Trent, thanks a lot. Navigate makes it work like I want it. Best...
Thomas Holste - 13 Years Ago
Thomas Holste - 13 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search