Solved

Continuous Form -- Hide unbound field unless current record

Posted on 2006-06-29
9
423 Views
Last Modified: 2008-03-17
Hello Experts,

this question may have been asked but I didn't find an answer that would have allowed me to fix my form problem.

Here's what I have:

- Form which is bound to a query.  The form's view = "Continuous".  
- The form has currently only 2 fields: [Comment], [ID];  while ID is hidden
- I also have a 3rd control; an unbound textbox

The main purpose of this form is to update records given certain criteria (it's not really important what this update entails).   However, what is important are the next few steps.

1. The update is done one record at a time (the currently selected record).   This is due to "manual review".
2. If the analyst decides to update the record, he/she clicks a command button (Auto-Correct).   Once clicked, the AutoCorrect function (again, not really important to discuss its functionality) kicks in and places the "new comment" (with its modifications) temporarily into the unbound textbox.
3. If the analyst agrees w/ the "new value" of the updated comment (which again, is temporarily held in the unbound textbox), he/she clicks on a 2nd command button and the value of the unbound textbox is then permanently stored in the comment field.

Okay, that's enough background... here's now my actual problem:

Due to using the continous form view, I see e.g. 3 records in the form.   Once step #2 (clicking the AutoCorrect function) is executed, I now see the "new value" of e.g. record #1 in as many unbound textboxes as I have records.   I didn't expect this, but it makes sense to me (now).

I tried the following:
- set unbound textbox's visible property to "no"
- in Event, set unbound textbox's visible property to "yes" on current record... that doesn't work though

Does anyone know of a "smart process" that allows me to stick w/ the current process (e.g. using the continue form view), but somehow "hide" the unbound textbox, except for the current record?

Thanks,
EEH

P.S. I hope this makes sense... if not, I'll be more than happy to post a sample db
0
Comment
Question by:ExpExchHelp
  • 5
  • 4
9 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 17009987
because its a continuos form, unbounded controls will get repeated for each row and u will find the problem u are getting
unbound does not work well with continuous

U could try create the textbox in the header section

And then on Form_current, u can update the textbox to hold the value of the current comment

private sub Form_Current()
    Me.unboundCommentBox = Me.Comments
end sub


The user can then make changes to the textbox, then on the click of a button, also in the header

private sub cmdApply_Click
    Me.Comments = Me.unboundCommentBox
end sub



well something along those lines anyway

note, it dont have to be in the header, it can be in the footer also
0
 

Author Comment

by:ExpExchHelp
ID: 17009998
KIS... keep it simple... header/footer works for me.

Thanks,
EEH
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17010012
Alternative perhaps is to present a listbox which shows your comments


As the user clicks on a listbox, u populate unbounded controls

then user can make changes to this unbounded control and click save
drawback is u have to create the sql to update it
e.g

sSql = "UPDATE table SET Comments = '" & Me.unboundCommentBox & "' WHERE ID = " & Me.ID
DoCmd.RunSQL sSQL

hmm, that looks familiar :)

0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17010020
Damn, that was quick, accepted before I gave the alternative!

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 65

Expert Comment

by:rockiroads
ID: 17010052
Im doing well today and u've helped with 2 of them
Last 10 answers have had my solution accepted

Worrying thing is, where have all the other experts gone to?
0
 

Author Comment

by:ExpExchHelp
ID: 17010056
Hmh, the comments can be very long (e.g. > 255 characters)... not sure if the listbox would be most suitable for their display... good idea though.

Again, thanx,

EEH

P.S.  While alternatives are always good..., the 1st instinct is sometimes the best 8)
0
 

Author Comment

by:ExpExchHelp
ID: 17010087
Congrats... good point... I posted question (in the past) where at least half-a-dozen experts kicked in ideas within minutes... maybe some getting tired of "easy" questions from new-comers like me and look for bigger challenges.  8)
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17010152
I guess its time of the day
The Experts are all volunteer's anyway so people like myself have a job. Perhaps people are busy with their jobs also.

0
 

Author Comment

by:ExpExchHelp
ID: 17010220
absolutely... I understand (about jobs)... I was just piggy-bagging on your comment since I had the same thought.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now