UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V  1 2 >  (Go to first unread post)
   Reply to this topicStart new topic
> Recordset + Unbound Control + Continuous Form    
 
   
tjcinnamon
post May 29 2007, 02:32 PM
Post#1



Posts: 194
Joined: 22-February 07



Is there a way to have an unbound text box on a continuous form which is able to have data entered into it such that it will not change when new data is entered.
CODE
****This is how I would want it to work*****
Bound txtItem     Unbound txtQuantity
Watch                       1                
Coat                        2
Hat                         2
Keys                        7

When I enter a value in the textbox all of the text boxes get that same value. So if the I enter a 1 they all turn to 1.
I have gotten around this by making a temporary table and binding the text box to that so the table holds values then I delete the values after the user is done.
Is there a way to bind the textbox to a recordset or some code that holds the values in memory
Go to the top of the page
 
Doug Steele
post May 29 2007, 02:42 PM
Post#2


UtterAccess VIP
Posts: 21,498
Joined: 8-January 07
From: St. Catharines, ON (Canada)


Nope. While it may look to you like there's, say, 30 instances of that unbound text box, in reality there's only a single instance, repeated 30 times.
hat's the point, though, of entering information if you're not storing it?
Go to the top of the page
 
LPurvis
post May 29 2007, 04:35 PM
Post#3


UtterAccess Editor
Posts: 16,086
Joined: 27-June 06
From: England (North East / South Yorks)


I believe you're already using the one method for having both sets of data updateable. i.e. existing fields updatable to its table and the new "ethereal" field updateable - but not bound to that same table.
Any other solution would remove the direct table bindings.
While I'm a believer that there are occasions for displaying data for subsequent updating (rather than live/bound - generally because it's stored in a more normalized fashion that it's being displayed) - those scenarios aren't common.
So I'd suggest you contemplate what Doug has to say on the subject. i.e. why do you want this?
Go to the top of the page
 
tjcinnamon
post May 29 2007, 11:47 PM
Post#4



Posts: 194
Joined: 22-February 07



/>
The point would be to give the user time to enter multiple quantities at once and then give them time to review the data before sending it off. So the items above Coat, Hat, Keys, would be available to enter quantities and then the user could send them off by lets say pressing a button or an autokey and then the numbers would be real data until that point they would be temporary data not meaning anything until the user says so. My previous method of this was to make a table called TempQuantity which held the values until they were ready to be sent to a table where they would mean something. Then I would clear the TempQuantity Table. I just was looking for another way to do what I was already doing without having an "unnecessary" table.
Go to the top of the page
 
LPurvis
post May 30 2007, 04:59 AM
Post#5


UtterAccess Editor
Posts: 16,086
Joined: 27-June 06
From: England (North East / South Yorks)


As I mentioned - if your desire is to have an effectively "split binding" then the two tables are your only choice.
(One of which is live - the other is your temp table for holding pending values).
inding to more than one location limits your choices - as does needing thing in continuous view. Similarly your unbound choices don't offer direct binding (naturally - like the name says ;-) so you'd have to iterate through rows and assign them in code afterwards. (i.e. no SQL appends/updates and so forth).
Go to the top of the page
 
tjcinnamon
post May 30 2007, 09:04 AM
Post#6



Posts: 194
Joined: 22-February 07



I just realized another reason for wanting to do this. I was having problems populating a junction table where one fk was required at the same time as another one was. It was where I was assigning an itemID fk with a MeasureID fk in a many to many relationship. To give the user maximum control I wanted all of the subforms in continuous view so they could see all of the options as well as current relations.

Are there unbound choices for a continuous form? How would I do that with code? If it's too complicated of pointless I'll avoid it. I'm trying to eliminate some areas of my current DB that seem to be work-arounds.
There is another instance where on the form I'm talking about I can only get the combo boxes to display data if I set focus to a field in each subform. So after data is updated I set the focus via code to 4 different combos to get the data to display. I figured that requery, refresh or even repaint would have done (considering the data was updated) that but with no avail I was forced to use a work around. These are the things I'm trying to eliminate for my own understanding, curiosity, and elegance of code and design.
Go to the top of the page
 
LPurvis
post May 30 2007, 10:12 AM
Post#7


UtterAccess Editor
Posts: 16,086
Joined: 27-June 06
From: England (North East / South Yorks)


Unbound methods are quite code biased yes.
Can you explain a bit more the difficulties you were having with the UI and temp tables?
Perhaps with examples or illustration?
Without specifics there are some general selection methods in the List Selections example here.
Only the first it specifically targeted towards using a Temp type table - but any could be I suppose.
Go to the top of the page
 
tjcinnamon
post May 30 2007, 02:21 PM
Post#8



Posts: 194
Joined: 22-February 07



Here is the file. Press F7 from the entry form and that is the measure assignment form. The ItemAssignmentSubform contains the TempQuan which is a temporary quantity table. If you check the relationships you can see how it is related. I had to have this table because I had to enter values at the same time to maintain a many to many relationship. My solution was to have the user enter the data and when it was ready to be sent I would send both foreign keys to the junction table at the same time. If you look at the AutoKey F5 from that form you can see how I get things to refresh.
Attached File(s)
Attached File  PO Database2k3.zip ( 387.13K )Number of downloads: 65
 
Go to the top of the page
 
LPurvis
post May 31 2007, 07:55 AM
Post#9


UtterAccess Editor
Posts: 16,086
Joined: 27-June 06
From: England (North East / South Yorks)


So what's the problem with it? If you can describe the exact problem and the objects involved and where they're manifesting.
(As I'm afraid I don't have the time to fully familiarize myself with applications).
Go to the top of the page
 
tjcinnamon
post May 31 2007, 12:50 PM
Post#10



Posts: 194
Joined: 22-February 07



Technically everything works fine. There are just work arounds that I'm using
) is how I refresh the form after I send the values from the temp table to the junction table. That can be found in the MeasureAssignmentForm Class Object. The Sub procedure is called SendAll and SendSelected. If you step through it, it seems more complicated than a seimple refresh. Refresh and Requery did not work.
2) The ItemAssignmentSubform which is located on the MeasureAssignmentForm, has the temporary table attached to it called TempQuan. I'm wondering if there is a way to get rid of it because it only stores values for a very short period of time. Plus I'm worried about mulitple users using the database at the same time it may mix up the data.
Go to the top of the page
 
JeffK
post May 31 2007, 02:49 PM
Post#11


UtterAccess VIP
Posts: 1,550
Joined: 19-December 02
From: Lansing, MI


Hey guys,

Sorry to butt in, but I remembered an example I had laying around for binding a continuous form to an unbound (in-memory) recordset. I agree with Leigh that often the coding involved is not worth the trouble, but I thought I'd post it so you can see the technique for curiosity or in case it does help.

The basic steps are:
Open a driver recordset bound to your entry table
Create an unbound ADO recordset (not intuitive if you've only worked with bound ones)
Loop through the driver to fill the unbound recordset
Set the unbound recordset as the form's recordset

Any changes made to the records via the form will be in-memory and only written back to the table by clicking Save, which explicitly writes the changes back. I also attached an image of a production app where I use the technique. It's a database portal system used by about 80 people at once, so it benefits a bunch from an unbound list, especially a list where I want some nice formatting on the selected record.

HTH
Jeff
Edited by: JeffK on Thu May 31 15:52:45 EDT 2007.
Attached File(s)
Attached File  UnboundRecordset.zip ( 71.24K )Number of downloads: 159
 
Go to the top of the page
 
tjcinnamon
post May 31 2007, 10:27 PM
Post#12



Posts: 194
Joined: 22-February 07



This is exactly what I'm looking for!!! Thanks a ton. The refresh thing is still baffling me. There is another instance that has arisen where this technique should work perfectly. UA you've done it again! Thanks LPurvis and JeffK
Go to the top of the page
 
JeffK
post Jun 1 2007, 07:30 AM
Post#13


UtterAccess VIP
Posts: 1,550
Joined: 19-December 02
From: Lansing, MI


I'm glad it helped. Good luck with your project!
Go to the top of the page
 
LPurvis
post Jun 8 2007, 06:36 AM
Post#14


UtterAccess Editor
Posts: 16,086
Joined: 27-June 06
From: England (North East / South Yorks)


OK I've now checked and I'm OK copyright-wise to post this. (Was reticent to from the very start of this thread... but it's cool now).
It's the created recordset concept - taken a few steps further. (It has limited update capabilities otherwise - i.e. you can't append to the form. This effectively allows you to create forms bound to nothing at all... with rows you insert on the form).
Technique
Recordset Binding
Example Implementation
Recordset Binding Example Implementation
Go to the top of the page
 
Maxer
post Jun 9 2007, 03:48 PM
Post#15


Utter Access VIP
Posts: 2,434
Joined: 14-March 06



How did you make your database table (the one in the image) look the way it does? (Well I assume it's a form not a table).

But with the header and the little icons off to the right?

Is that in your example (not at a computer with Access so I can't open the DB at the moment).

However, it is a very attractive layout.


EDIT:
Ok opened your example: Question- you use .clone to update the recordset.

You say it is because it only impacts the updated/modified records.

Can you elaborate on how that is the case?

I thought the clone just made a copy (or is it a pointer?) to the original recordset? What bearing does that have on updating ONLY the modified records?

In the past to track modified records I've set a boolean switch so that everything starts as FALSE (not modified) then each time one of them is changed or undone it flips the switch accordingly.

When I update I use an UPDATE statement and WHERE Modified=True to select only the changed records.

Thanks.
Edited by: Maxer on Sat Jun 9 16:56:00 EDT 2007.
Go to the top of the page
 
tjcinnamon
post Jun 10 2007, 12:41 PM
Post#16



Posts: 194
Joined: 22-February 07



The links don't work to the databasedevelopment.co.uk site. This looks very intriguing, I think it could be useful in my project.
Go to the top of the page
 
LPurvis
post Jun 10 2007, 06:52 PM
Post#17


UtterAccess Editor
Posts: 16,086
Joined: 27-June 06
From: England (North East / South Yorks)


My website appears to be down for the moment. Very odd. (Can't remember the last time this was the case).
I'll look in to it.
Go to the top of the page
 
tjcinnamon
post Jun 11 2007, 03:00 PM
Post#18



Posts: 194
Joined: 22-February 07



Could you post the recordsetbind.zip file off of your website so I could take a look at it.
Go to the top of the page
 
LPurvis
post Jun 11 2007, 03:03 PM
Post#19


UtterAccess Editor
Posts: 16,086
Joined: 27-June 06
From: England (North East / South Yorks)


Yep.
(I'd hoped it would be back up before now... alas not. Will have to shout at my ISP ;-)
Here are the samples. (One method - one example implementation).
Attached File(s)
Attached File  RecordsetBind with Example.zip ( 243.34K )Number of downloads: 86
 
Go to the top of the page
 
tjcinnamon
post Jun 12 2007, 04:21 PM
Post#20



Posts: 194
Joined: 22-February 07



I tried to implement the BoundFormGrid Method to my project. I couldn't get it to work. That method is too complicated for me, and my needs, although I feel that it would work (assuming I knew more).
Is there an easier way if I only want one textbox to store an integer until its saved or cleared??
Could you steer me in the right direction.
I have posted my project, if you would like to take a look
Thanks, JOe K.
p.s. I will continue to try and figure out this code. I have analyzed it all day!!!
Attached File(s)
Attached File  Copy of PO Database2k3.zip ( 409.29K )Number of downloads: 53
 
Go to the top of the page
 
2 Pages V  1 2 >


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 10:20 PM