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!

Creating a "floating" subform ?

Status
Not open for further replies.

blakex1

MIS
Oct 30, 2000
17
US
I'd like to create a form that functions like a subform...ie: it updates itself as the current record in the main from changes.
A subform works fine for me but the only problem I have with it is that you're not allowed to make the main form a 'Continuous form' with a subform. Access limits you to using a 'Single Form' when you want to implement a subform. Single forms only allow you to see one record at a time. I'd rather be able to see multiple records...and just select one of them.... and have the popup box show up so that i could enter and save comments about the record I had selected.
Any Ideas would be appreciated. Thanks,

Blake_x1@hotmail.com



It would be nice if i could just create a popup form that mimics the actions of a subform....but wasn't embeded in the main form.
 
Have a main form and put two subforms on it.
The main form basically has nothing its just a holder for the two subs.

I do that a lot.
Here is a Screen capture form My WEB site

This is actually is a list box on top and a subform below.
The List box has the multi select property set to simple
So the user could see any items they picked, cause a subform you can only show one item and when you click a different record the first item becomes un-highlighted.
So in the “On_Click” event of the list box, I create a new record and a requery the sub form.
DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
Or visit my WEB site
 
Thanks for the ideas Doug. I tried the listbox..but it turns out i have 26 fields and listboxes are limited to display only 20. I worked on the 2 subform idea but I decided it would be best to just use a popup comment form instead. I wrote some code to pass the 3 values that I want to move. It then sets the focus to the comments form, then refreshes it and then refreshes it and moves the focus back to the main form.

Private Sub Form_Current() '--when current record in the main form changes,do the following
Forms![ProjAnalysisComments].Open
'--Open the commment form
Forms![ProjAnalysisComments]![CourtID]= Me![COURT_ID]
'--Pass this value to comments
Forms![ProjAnalysisComments]![Filetype]= Me![FILE_TYPE]
'--Pass this value to comments
Forms![ProjAnalysisComments]![COLID]=Me![COLL_ID]
'--Pass this value to comments
Forms![ProjAnalysisComments].SetFocus
'--move focus to comments form
Forms![ProjAnalysisComments].Refresh
'--refresh the form with the values
Forms![ProjAnalysisComments].LostFocus
'--comments form looses focus
Forms![ProjectionSubform].SetFocus
'--Resets focus back to main form

I'm close i think, but the code isn't complete. I get an error saying the form ProjAnalysisComments is not open.
Let me know if you have any ideas.
Thanks.
 
A simpler way to keep your subform refreshed may be this...

Use the timer function in the subform's properties. Under timer interval use a value of about 1000, and the On Timer Event Procedure is a simple, Me.Requery.

This will refresh the info in your subform almost as quickly as you enter it in your main form.

Also I would change your form open command to:

DoCmd.OpenForm "ProjAnalysisComments", acNormal, , _
"CourtID = " & Me.COURT_ID

Hope this helps.



 
to open a form use the
DoCmd.openform ....
function DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
Or visit my WEB site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top