Solved

Continuous Form -- Hide unbound field unless current record

Posted on 2006-06-29
9
424 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

911 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

17 Experts available now in Live!

Get 1:1 Help Now