Q: Very strange error in combo-box wizard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I'm using access 2000. I'm trying to use the combo box wizard to find a
record based on the selected value of the drop down. However, when I select
the field, I get an error "Could not find file c:\my documents\SELECT
T_Satisfaction_Survey.mdb"

I'm totally confused as to what this error is telling me. The table on which
the form is based is native to the mdb I'm working in.

The recordsource for the form is as follows:
SELECT T_Satisfaction_Survey.* FROM T_Satisfaction_Survey;

I tried compacting, but it doesn't work. If I create another form based on
the same table and try the combo box wizard, it works just fine.

Any ideas? I have no idea why it'd search in c:\my documents\ or why there's
a SELECT in there.

Thanks!
-Mark
 
Hi Mark,

rather than using the wizard, set the needed properties for
the combobox yourself

here is an example with the properties you need to set for a
combobox control

Name --> EmpID
ControlSource --> EmpID
RowSource --> SELECT EmpID, EmpName FROM Tablename ORDER BY
EmpName
BoundColumn --> 1
ColumnCount --> 2
columnWidths --> 0;2 (etc for however many columns you have
-- the ID column will be hidden. By choosing 0 for the
first columnwidth, it will be hidden)
ListWidth --> 2 (should add up to the sum of the column widths)

EmpId will be stored in the form RecordSource (if the
control is bound) while showing you names from another table...

If you want to modify the RowSource, you can use the Builder
(...) button: click in the RowSource property and you will
see if off to the right

Once you pick something from the combobox, are you wanting
to find the record on the current form? Assuming the bound
column is numeric:

put this code on the AfterUpdate event:

'--------------
If IsNull(Me.ActiveControl) Then Exit Function

'save current record if changes were made
If me.dirty then me.dirty = false

Dim mRecordID As Long
mRecordID = Me.ActiveControl
Me.ActiveControl = Null
Me.RecordsetClone.FindFirst "IDfield = " & mRecordID

If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Sub
End If
'--------------


Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
you're welcome, Mark ;) happy to help

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
Back
Top