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!

combo box problems

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
I'm having trouble with a combo box.

I'm trying to use a Combo box to call up a record. I then need to view and/or edit this record.

There must be a way to do this, but I can't get it to work. I have created a form with all the fields from the table. I then removed the Property ID field and added a combo box using the wizard choice #3. This box is attached to the Property ID field.

When I try to use it I get the following message: Me.Bookmark = rs.Bookmark

If any one has suggestions on what I can do so I can call up particular records and then edit the data in them I'd love to hear from you.

I'm a newbie so if the answer is right in front of me I might just not be seeing it.

Thanks for your help and guidance.
Sam
 
The 3rd option of the combo wizard stands for unbound combobox.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
cheyenne2002 . . .

In parallel with [blue]PHV[/blue]:
[ol][li]Move the combo to the header of footer of the form.[/li]
[li]Clear the [blue]Control Source[/blue] property (make the combo [blue]unbound[/blue]).[/li][/ol]

Calvin.gif
See Ya! . . . . . .
 
AceMan1,
I moved the combo box to the header and the control source is blank for the CB.

I am still unable to edit my records.

I'm trying to start from the beginning again. I have a form and I added all the records from a qry (table only to start). I removed the property ID field and added a combo box using the Prop ID as the source. so far so good.

I then went to the query and added a second table and check the form, good.

I then added a field or two from the second table to the query. so far things seem to be working ok.

I then added a tab object to put my fields on so I can organize them. Keep your fingers crossed, I hope this works. I don't have time to fool with this thing. Seems Mother Nature is still angry with SoWest FL. I live in Port Charlotte, where Hurricane Charley landed last year and now Wilma might be headed here......

Oh well.....thanks for the help. I'll get back to this post if what I'm doing now does not work. My plan B is to have 3 forms, 1 for data entry, 1 for editing, and 1 for viewing.....

Sam
 
cheyenne2002 . . .

Why would you do what where indicating you shouldn't!

In any case, when you open the form have a look at the AddNew button
AddNewEnabled.BMP
. If it has that disabled look
AddNewDisabled.BMP
, then there's a [blue]problem with your RecordSource[/blue] . . .

Calvin.gif
See Ya! . . . . . .
 
I See what you mean. Can you give me hints of why a Recordset would not be updateable. that is the error message I'm getting on my original form.

Sam
 
I have successfully done one of the form. But when I tried to do the second form I get an error when building the combo box.

This is the code behind it; The last line is the problem "Me.Bookmark = rs.Bookmark"

I have no idea what it is trying to tell me is wrong, can you help?
Sam

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[PropertyNo] = '" & Me![Combo270] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 
I think you are trying to do this --


Private Sub combo270_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[propertyNo] = " & Chr(34) & Me![combo270] & Chr(34)
Me.Bookmark = rs.Bookmark
Set rs = Nothing
End Sub

Bob
 
...and what I'm trying to do is post in my sleep. Here's the rest of it.

Put combo270 in the header of the form that you want to use to edit your data. Click on its EVENTS tab and put [Event Procedure] on the AfterUpdate line and click the button with 3 dots. Paste in the sample code that both of us have now posted.

This has worked for me many times. I would also put the PropertyID textbox back on the form. It will give you a little pat on the head and assure you that you have retrieved the record that you want. Later, you can set its VISIBLE to No.
Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top