Bookmark to a new form

JordanR

Registered User.
Local time
Today, 02:03
Joined
Jan 25, 2005
Messages
72
I have a search form (Form A) that as I type in a text box the contents of the listbox refreshes to show only those items that match the text in the text box.
When you double click on any of the items in the listbox it jumps me to a detail form based on the ID field.
On the detail form, there is a subform for any notes which uses a listbox (it lists all the notes entered for that detail item).

The notes subform listbox is only displaying the first note entered in the database....
So if I search for information in case 43, I find case 43. I double click on case 43 and the details for case 43 pop up. I go to the notes subform and the listbox showing all the notes entered is only showing the notes for case number 1.

Any thoughts?
 
How did you define the row source for the list box? And how are you storing the notes in your table? Is each note stored in a separate field, or is this one large memo field with notes stored in it? It sounds like you need to check your query to see that the case number for the subform is linked correctly to the case number that is selected on the parent form.
 
Ok, this is interesting. The listbox is displaying the contents of Note1 even though I'm on note XX (where X is any other number). But if I click on the listbox and go to Record - Refresh it fixes it and displays the correct notes.
SO.... how would you make it do that from code?
I've tried docmd.RunCommand acCmdRefresh on Load of the subform, on Activate of the subform and on Click on the tab the subform sits on.
Any help?
 
I would stick the docmd.RunCommand acCmdRefresh on the after update event of the txtbox. See the attached database for the proper use of the refresh command, if you call the command when using a SQL string in VB Code, you will get an error stating the Refresh command is not available, in that case you need to use the Requery.
 

Attachments

I definitely didn't describe my problem well. Attached is a sample database.
Problems I'm having with the database as it stands:
1. Open the case form. View the notes. Everything looks ok. But scroll to Case #2 and you'll see the notes from Case #1. Refresh the listbox and now it will display notes from Case #2.
2. Which I suspect is related to issue 1, is when you open the search case form and double click on case #2, you'll get notes from Case#1 unless you manually refresh the listbox again.

Any thoughts?
 

Attachments

Have a look at the changed sample. (FieldSearch2.mdb)

Have a look at the query behind the list box in Form Search Case.

You will see that I have moved:

Code:
Like "*" & [Forms].[SearchCase].[txtSearch2] & "*"


Also removed the ID fields ( don't have to but you can't search on them so why display them)

Hope this was a help.
 

Attachments

I'm not sure, but did you attach the right DB? The one you attached and the one I attached look identical and are behaving the same way.

Thanks for the help though.
 

Users who are viewing this thread

Back
Top Bottom