Results 1 to 7 of 7

Thread: Value in unbound text box in DB restore

  1. #1
    Join Date
    Apr 2010
    Posts
    73

    Value in unbound text box in DB restore

    Hi, I have form (Form1), the fields from multiple tables in Datasheet view shows a. Database is a query. One of the fields (name: description) is a memo field (rich text) with a relatively long text content that can be seen leafing through the form in Datasheet view only partial. Therefore, I open a new form (name: Form2) with an unbound text box (name: txtDescr), in which the contents of the description field for each DS-change is written. I thought the fact that Form1 has a query as the basis (Dynaset) have minimum the description field to restore. But unfortunately not!! How do I change the code so that changes also "restored" to be?

  2. #2
    Join Date
    Mar 2008
    Posts
    192

    Re: Value in unbound text box in DB restore

    It will be really helpful if you provide some sample of coding that you are trying to discuss. Actually getting it just from the query that you have mentioned is really tough. So, I would like to recommend you to provide some sample of coding which will definitely help many of us to understand. Also, it would be better if you tell us the configuration that you are working on.

  3. #3
    Join Date
    Apr 2010
    Posts
    73

    Re: Value in unbound text box in DB restore

    Extremely sorry for not providing enough information.

    Code:
    Form1: 
    Private Sub Form_Current () 
    Forms! Form2 [txtDescr] = Me! [Description] 
    End Sub
    This works quite well.
    What I would like now: If I make changes in the unbound text box, these should be written into the description field or in the DB. The following code does not do that

    Code:
    Form2: 
    Private Sub txtDescr_AfterUpdate () 
    Forms [Form1] [Description] = Me! [txtDescr] 
    End Sub
    The following are the configuration that I am working on :
    • Business Application: Access
    • Office Version: Office 2007
    • Operating System: Windows XP

  4. #4
    Join Date
    Mar 2008
    Posts
    192

    Re: Value in unbound text box in DB restore

    Form2:
    Private Sub txtDescr_AfterUpdate ()
    Forms [Form1] [Description] = Me! [txtDescr]
    End Sub
    Form1 is the editable? This means you can change it by hand and direct data, such as a Description rewrite? If not, then probably the query read behind it. Test the next, adding try to change a description directly in the query. If that does not work, then post here once the SQL text of the query.

  5. #5
    Join Date
    Apr 2010
    Posts
    73

    Re: Value in unbound text box in DB restore

    Thanks for your reply. I am in the meantime a little further, but still not quite understand what makes Access here (or does not). My goal was actually quite simple: the details of a field of the first form (in datasheet view) should be shown on a second form in a large (unbound) text box and been writing back changes. The fields of the first form are bound to a query. I'm now an unsatisfactory solution found to work but is ugly. I've found that the after events such as update or change will be triggered while (test with MsgBox), the changes are not written back. My solution: In the second form I place a hidden text box (frame transparent) which I just put the focus. The window left only leads to strange behavior. The following code works:

    Code:
    Form2: 
    
    Private Sub txtDescr_Change () 
    Forms! F_Form1 [Description] = Me! txtDescr
    Me.txtDummy.SetFocus 
    Me.txtDescr.SetFocus 
    Me.txtDescr.SelStart = Len (Me.txtDescr.Text) 
    Forms! Form1 [Description] = Me! TxtDescr
    End Sub
    The whole thing actually works only when there is a change in focus and the instruction is given to restore twice!! Form1 Forms [Description] = txtDescrMe.

  6. #6
    Join Date
    May 2008
    Posts
    376

    Re: Value in unbound text box in DB restore

    The whole thing actually works only when there is a change in focus and the instruction is given to restore twice!! Form1 Forms [Description] = txtDescrMe.
    My questions about what happened with your old code and if it was safely performed, are still open. Comment your code above crutch of times and do a Test in the after update event of TxtDescr, simply
    MsgBox Me! TxtDescr
    Or
    Debug.Print Me! txtDescr
    Do you get to the _ amended _ text message or in the test window?

  7. #7
    Join Date
    Nov 2008
    Posts
    1,192

    Re: Value in unbound text box in DB restore

    The solution of the problem is (as always) simple. One has only to call Forms! Form1 [Description] = Me! txtDescr... by replacing >>> Forms! Form1 [Description] = Me! TxtDescr.Text <<< and everything works as intended. Obviously, the problem occurs because the default setting "Value" that, for whatever reason ...

Similar Threads

  1. Replies: 7
    Last Post: 23-02-2012, 11:25 AM
  2. How to restore the deleted text messages on icloud backup IOS 5
    By Culpritism in forum Portable Devices
    Replies: 3
    Last Post: 30-12-2011, 12:15 PM
  3. Unbound Sprint and Aim in Serious Sam 3: BFE
    By Akshey in forum Video Games
    Replies: 9
    Last Post: 26-11-2011, 12:05 PM
  4. Line Rider 2: Unbound game application issue
    By Kaufman in forum Video Games
    Replies: 5
    Last Post: 30-03-2010, 05:40 AM
  5. how do i load data into an unbound datagridview
    By Daren in forum Software Development
    Replies: 5
    Last Post: 03-03-2009, 04:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,237,248.21498 seconds with 17 queries