Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem With Unbound Control in ADP

Status
Not open for further replies.

HenryE

IS-IT--Management
Apr 30, 2002
42
US
Hi All,

I have what may be a very simple problem:

I have a database in Access, where in one of the forms I can perform searches using an unbound control. Works fine. Basically, the unbound control is a combo box that enables the user to choose from among a list, and based on that choice the form returns a particular record.

I'm trying to do the same thing with an ADP version of this database. But the search on unbound control thing doesn't work. Instead, I get an error: "Run-time Error '438' Object doesn't support this property or method".

Am I making a mistake in assuming that if it worked in Access it should work in ADP? Is there something about the fact that the backend is a SQL Server that makes this method invalid?

Thanks.

Henry
 
cmmrfrds,

I actually sort of fixed the problem. I did this by creating a new unbound combo box and using the combo box wizard to make it a search-for-a-record combo box. That worked in the ADP. So then I did the same thing in the MDB (pure Access) application, and it used the same code as the ADP code. This wizard-created code was quite different from the code I had created, which works for the MDB application, but not for the ADP application.

Here is the code I had created, and which worked only for the MDB application:

Sub Combo20_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[IDNumber] = '" & Me!
[Combo20] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Here is the code the MDB and the ADP wizards created:

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

Set rs = Me.Recordset.Clone
rs.Find "[CaseNumber] = '" & Me![Combo256] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

So now the ADP application works, but I'm not sure exactly why this code works while mine works only with pure Access (I have a guess, but I'm a newbie at this, so I'm probably wrong).

Thanks.

Henry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top