Solved

Continuous Form -- Hide unbound field unless current record

Posted on 2006-06-29
9
428 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 65

Expert Comment

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

0
 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

630 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