Results 1 to 6 of 6
  1. #1
    razzel is offline Novice
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    4

    Show data in textbox

    Hi everybody and Merry Christmas!



    I have an Access table with several columns and corresponding field names. The purpose of the db is to keep track of ipads, macs and pcs on some schools.

    One of the fields is named "Departments". Now, every School is divided into different departments based on the age of the students, like this:

    School A
    Department1
    Department2
    Department3

    On School A Department2 got 10 ipads, so in the table each one is registrered by serialnumber. And since Department2 have 10 iapads, there will be 10 rows in the table that reflect this fact.

    I have created a form and on the form I have put a textbox. To fetch the information about the 10 ipads (I just want to put the number 10 into the textbox), I use this string:

    =abs(Summa([IPads]![Building]="Department2"))

    The strange thing is that it will work until a restart Access. If I close down Access and restart it, the form will not show me the number 10, instead it will say #Error.

    Anybody that can spread some light on this?

    I am using Access 2013, Windows 8.1

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What is Summa() - is that a custom function?

    Is Building field in the form RecordSource?

    Is the textbox in form Footer section?

    Try: =Sum(IIf([Building]="Department2",1,0))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    razzel is offline Novice
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    4
    [QUOTE=June7;258103]What is Summa() - is that a custom function? YES, summa is sum on Swedish (I am using the Swedish version of Access 2013)

    Is Building field in the form RecordSource? What exactly is the "RecordSource"?

    Is the textbox in form Footer section? YES

    I did make another test and put this in the Controlbox:

    =Antal([Serienummer])

    Antal = Count

    It works perfectly until I close Access and open Access again. Then the
    textbox shows #Error.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Then Summa is intrinsic function, not custom.

    The RecordSource is property of form. It binds the form to data (table or query).

    No idea why the expressions errors. The syntax looks good. If you want to provide db for analysis, follow instructions at bottom of my post. Don't know what will happen when I open the db but will try to review it anyway.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    razzel is offline Novice
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    4
    Quote Originally Posted by June7 View Post
    Then Summa is intrinsic function, not custom.

    The RecordSource is property of form. It binds the form to data (table or query).

    No idea why the expressions errors. The syntax looks good. If you want to provide db for analysis, follow instructions at bottom of my post. Don't know what will happen when I open the db but will try to review it anyway.
    I thrashed the entire db and recreated it form scratch and now everything is working just fine. :-)

    I have a short follow-up quesation: can I create a button and have it open a question? If so, I would put the button directly into the form.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What do you mean by 'open a question' - open a form that displays a record? Yes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. How to show textbox info in a messagebox
    By hendrikbez in forum Macros
    Replies: 1
    Last Post: 12-03-2014, 09:57 AM
  2. show usename when textbox is dblclick
    By pimpzter in forum Access
    Replies: 3
    Last Post: 09-25-2014, 07:00 PM
  3. Replies: 4
    Last Post: 04-03-2014, 08:03 AM
  4. Replies: 8
    Last Post: 04-12-2013, 08:59 PM
  5. Replies: 4
    Last Post: 07-07-2012, 07:14 PM

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