vivasuzi
Programmer
- Jun 14, 2002
- 183
Hi!
I have a combo box, as many people seem to. Right now it's pretty straight forward. Selecting a company from the combo will bring up that companies info in the subform.
Here's how -->
Ok that works.
Then I have an Add a Record Button, hitting this will open a blank record for the user to add
Works fine, however I had trouble with people trying to add one record right after the other. So I came up with this idea, I added a Save New Record button. After the user enters in the new company info, they hit Save. This saves and data refreshes and form goes back to first record.
---------------------------------
PROBLEM:
When the user adds the new record, it is saved just fine, and refreshs to show in the combo box. HOWEVER, if the user chooses to select this record later on, it will not come up. Instead the first record comes up. So even though it's Saved and Refreshed, it won't come up in the subform UNLESS you close the form and reopen it.
This is a pain. Please help! I was thinking there might be a few lines of code I could add into the Combo Box so that if you select from the Combo Box, it automatically refreshes data in the Sub Form so that you have can see the new records.
If more info is needed, let me know!
*Suzanne* ![[elephant2] [elephant2] [elephant2]](/data/assets/smilies/elephant2.gif)
![[wiggle] [wiggle] [wiggle]](/data/assets/smilies/wiggle.gif)
I have a combo box, as many people seem to. Right now it's pretty straight forward. Selecting a company from the combo will bring up that companies info in the subform.
Here's how -->
Code:
Me.RecordsetClone.FindFirst "[COMPANYname] = " & Chr(34) & Me![Combo28] & Chr(34)
Me.Bookmark = Me.RecordsetClone.Bookmark
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Ok that works.
Then I have an Add a Record Button, hitting this will open a blank record for the user to add
Code:
DoCmd.GoToRecord , , acNewRec
Works fine, however I had trouble with people trying to add one record right after the other. So I came up with this idea, I added a Save New Record button. After the user enters in the new company info, they hit Save. This saves and data refreshes and form goes back to first record.
Code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.GoToRecord , , acFirst
---------------------------------
PROBLEM:
When the user adds the new record, it is saved just fine, and refreshs to show in the combo box. HOWEVER, if the user chooses to select this record later on, it will not come up. Instead the first record comes up. So even though it's Saved and Refreshed, it won't come up in the subform UNLESS you close the form and reopen it.
This is a pain. Please help! I was thinking there might be a few lines of code I could add into the Combo Box so that if you select from the Combo Box, it automatically refreshes data in the Sub Form so that you have can see the new records.
If more info is needed, let me know!
![[cat2] [cat2] [cat2]](/data/assets/smilies/cat2.gif)
![[elephant2] [elephant2] [elephant2]](/data/assets/smilies/elephant2.gif)
![[wavey] [wavey] [wavey]](/data/assets/smilies/wavey.gif)
![[wiggle] [wiggle] [wiggle]](/data/assets/smilies/wiggle.gif)