Results 1 to 4 of 4
  1. #1
    EdKerm is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2016
    Location
    Australia
    Posts
    7

    two forms both open both based on same table - locks when trying to save from second form

    Hello from this newbie member. I hope the above post title accurately describes my little problem.



    1. Underlying table name = Booktext ---- relevant field = booktext1
    2. basic input form name = simple Form Booktext Query choose edit range [call it form1 for simplicity sake]
    3. second input form name = FieldBooktext2expanded [call it form2 ....]
    4. (not relevant, just for info) each record is based on a numbered field "pararef" (not an auto number field) so the book is sorted/ordered to this manually assigned text field


    forms 1 & 2 are both based on table Booktext and are both open at the same time and update of relevant field booktext1 occurs as explained below (I have been unable to work out a good/elegant method of achieving what I want ...).

    Processing/intent: form 1 is the main/basic input form of text for my book. It has the input field booktext1 which updates the Booktext table. This field cannot take up much of the visible screen space in form1 (for reasons too complicated to explain here) and so sometimes (fairly often) it's content is greater than what can be seen on screen. I get sick of having to move the sidebar handles to see the text at the bottom of the field. So for convenience, I have this routine - double click of field booktext1 in form1 opens form2 which has a full screen version of the input field booktext1. That's fine, works OK. But when I come to save form2 it of course.

    The processing "flow" (simplified) is as follows: Open form1, go to relevant existing pararef (or create a new one); type material into field booktext1; decide I want to use/type stuff into form2; open form2 by double clicking field booktext1; type stuff into form2 booktext1 field; save form2 input; view book report for that pararef based on what I've input/saved;

    I have experimented a little with close/save of form1 after opening form2 to pararef = to form1's pararef and/or using setvalue for pararef but seem to run into trouble. so I thought it simpler to go to the Access gurus rather than waste any more time on what (I am sure) is a simple fix.

    Using MS Access 2007 on a Win 10 64 bit machine. Hoping someone can help ....

    EdKerm

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Not sure we can propose a fix if we don't know the purpose of the db or its forms. Surely you are not using Access to write a book??
    If not, you might require a form/subform design, but I think you need to enlighten us on the purpose of the db, or at least the form you're using, that has so much text in some field that you cannot see it all on your screen. That's a first for me. That is the purpose of side scroll bars - when content doesn't fit within the vertical space provided.

    Again, depending on the process, possibilities are using the mouse wheel instead of scroll bars, or moving to the end of the text in the control, but that requires an update on the control (I know of no other event to use) and probably can't be done on a memo field if it contains more characters than 3,2767.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by Micron View Post

    ...Surely you are not using Access to write a book
    Sorry, but I have to agree with the above, 100 percent! There are programs out there designed for this task, but Access isn't one of them!

    That said:

    1. Scrap your second Form
    2. Add a new Textbox to your original Form
    3. Name it booktext2
    4. Set its Control Source to the same Field as booktext1 (Yes...two Controls on one Form can share a Control Source!)
    5. Size booktext2 as large as you want and position it appropriately

    Now use this code:

    Code:
    Private Sub Form_Current()
      booktext2.Visible = False
    End Sub
    
    Private Sub booktext1_DblClick(Cancel As Integer)
      booktext2.Visible = True
      booktext2.SetFocus
       If Not IsNull(Me.booktext2) Then
         If Len(Me.booktext2) > 32767 Then
           booktext2.SelStart = 32767
         Else
           booktext2.SelStart = Len(Me.booktext2)
         End If
       End If
    End Sub
    
    Private Sub booktext2_DblClick(Cancel As Integer)
      booktext1.SetFocus
       If Not IsNull(Me.booktext1) Then
         If Len(Me.booktext1) > 32767 Then
           booktext1.SelStart = 32767
         Else
           booktext1.SelStart = Len(Me.booktext1)
         End If
       End If
      booktext2.Visible = False
    End Sub

    When you DoubleClick on the small Textbox the larger one will open, for viewing/data entry.

    When you DoubleClick on the larger Textbox it 'closes' and Focus returns to the smaller one.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    EdKerm is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2016
    Location
    Australia
    Posts
    7

    thanks a million, you're a genius

    thanks a million, you're a genius - I haven't actually incorporated your code but it looks the goods! I will let you know how I get on, later.

    re using MS Access to write a book -- Yes, I have a data base with about 6,400 records in it which relate to my grandfather's "life and times". This includes sentence/paragraph extractions from family letters (about 100 done so far) and stuff from the internet re Boer War & WW1. I decided early on that it would be handy to be able to link and/or copy info/data from the data base to the book and this works really well. I like the book design (based on a "downwards hierarchy" of structure = Book name, Part No/title, sub-heading No/title, chapter No/title, paragraph No/title, endnote No/contents) this actually lends itself perfectly to being in Access. I also like the inclusion of an "audit file" which records every edit change (not that I use that, I print off hard copy); I do use the "hide/unhide" button (which makes any particular paragraph be included in a print report or not). Then I print off the book report (all or part of) into PDF and that can be put straight, as is, into a Kindle textbook file. Too easy. Who would use MS Word for something as huge as my book is developing into? I have found that MS Word's handling of image file position is less than useful. In my self-designed book reports in Access I can place any combination of about ten image fields (various sizes) in various positions on the book page, intermingled with 3 main blocks of text, and quite adequate for my needs. And in the access forms I can/have incorporated various "search" boxes to enable me to go quickly and directly to wherever I want to be in the book, easier than in MS Word. As for the querying and reporting stuff, it is far more powerful than anything I could dream up in Word ... At present I have about 170 paragraphs in my book (a long long way to go yet), each para at least 2 pages long. EdKerm

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-01-2015, 02:22 PM
  2. Replies: 7
    Last Post: 09-15-2014, 11:55 AM
  3. Replies: 8
    Last Post: 02-03-2014, 07:01 PM
  4. Replies: 7
    Last Post: 12-02-2012, 08:32 PM
  5. Open 1 of 2 Forms based on Criteria
    By DCV0204 in forum Forms
    Replies: 28
    Last Post: 11-23-2011, 03:09 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums