Results 1 to 13 of 13
  1. #1
    jclausen is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2010
    Posts
    7

    Continuous form problems

    Hi,

    I have a continuous form in Access 2003.

    I am using the following code:

    Code:
    Private Sub Form_Current()
        Dim answer As String
        Dim stParam As String
        answer = False
        stParam = "S:\scandb\" & Forms![VIEW_PDF_STATUS]![COUNTY] & "\" & Forms![VIEW_PDF_STATUS]![Text82] & "_V" & Forms![VIEW_PDF_STATUS]![VOL] & "_P" & Forms![VIEW_PDF_STATUS]![PAGE] & "_ID" & Forms![VIEW_PDF_STATUS]![ID] & ".pdf"
        If Dir(stParam) = "" Then
        answer = False
        Else
        answer = True
        End If
        Me.Label79.Visible = answer
        Me.Repaint
        
    End Sub
    I am trying to display label79 if the code finds that the file exists.

    What happens is that it doesn't display label79 until I click where label79 should be showing up. That is only on a record that is flagged as true.
    When it does display, it shows up for all the records. I am confused!!

    Here is an example in which record 209 is the only one that will be flagged as true:

    Before click:



    After click:



    The above happens when I click the blank space where "PDF Attached" should be displayed.

    I want it to show up without clicking anywhere and only on the record flagged as true.

    Thanks in advance for the help,


    John

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    first of all, the label showing up on every record is natural is cont. forms. you can't prevent it. there is only one label control, not 6 different ones, as your form appears to be showing.

    secondly, the .visible property returns a boolean, and your "answer" variable is dimmed as a string, and additionally it is assigned to the property as a boolean. none of that makes sense.

    3rd, which I don't know 100%, the current() event is not the best event for this, but it might be your only option. I believe, don't quote me, that this event updates everytime the form updates (is legally changed).

    if you want this to appear on one record only, you'll have to apply a filter or change the form type.

  3. #3
    jclausen is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2010
    Posts
    7
    Ok, I understand what you are saying. That makes sense.

    How should I approach this? What type of form will allow me to accomplish this?

    Thanks again,
    John

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    a single or split form will let you do it. a filter on a cont. form will also do it, because it disappears all of the records that don't apply. hence, one record shows only, thus one label.

  5. #5
    jclausen is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2010
    Posts
    7
    I am confused for sure.

    On a split form, I would have to select the record in the list before I could see the "PDF Attached" message. Correct?

    A single form wouldn't allow multiple records on the same form would it?

    All I am trying to do is see a list of records and verify if a file exists for that record.
    Could I accomplish this with a report?

    Thanks again,
    John

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by jclausen View Post
    All I am trying to do is see a list of records and verify if a file exists for that record.
    you're missing the point John.

    You can only see a list of records on one screen, in a form, 2 WAYS: in a datasheet or a cont. form. make sense? there are no labels (generally speaking) on datasheets, so that leaves you with option 2.

    option 2 will not let you see 1 label with the 'PDF' attached caption on it. make sense again?

    you can't have your cake and eat it too, in this situation. you have to workaround it, or use another program for it.

    your original problem was nothing really: too many labels appear when the code runs. I have explained why that happens, and HAS TO happen, in the above section.

    additionally, a report has nothing to do with solving the problem here, because if you look at it in terms of what tools become available by using a report instead of a form to look at your data, there are no significant differences between the 2. at least none that will benefit you and the current problem you're having.

  7. #7
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    create a column in the form, set the data source to:
    =dir("S:\scandb\" &[COUNTY] & "\" & [Text82] & "_V" & [VOL] & "_P" & [PAGE] & "_ID" & [ID] & ".pdf")=""

    then this column will show true or false depend on the existance of the .PDF file.

  8. #8
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    weekend,

    that will confuse the person even more. that's not the issue he was trying to solve. he's already done similar to that.

    <edit>
    a transparent background will work. I retract my previous post. very nice.

  9. #9
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I agree.

  10. #10
    jclausen is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2010
    Posts
    7
    Just set the background of the form to transparent and leave the rest alone?

    I didn't catch that...but I think everyone knows that by now.

    Thanks,
    John

  11. #11
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    john,

    he's saying, behind the label, put:
    Code:
    =dir("S:\scandb\" &[COUNTY] & "\" & [Text82] & "_V" & [VOL] & "_P" & [PAGE] & "_ID" & [ID] & ".pdf")=""
    in the control source property. that will give you what you want.

    make sense? it makes the label visible ALWAYS, but the records that have "" as the caption for the label will not show anything on the forum that's visible to the eye.

  12. #12
    jclausen is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2010
    Posts
    7
    In the control source property of the label?

    Or make a new Text box and put it in there?

    Please bear with me...

    John

  13. #13
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I'm sorry John.

    Both of us have seriously screwed up this thread. my apologies. cs's don't exist for labels. YES, you will have to use a textbox with a transparent background. weekend should have pointed this out long ago as well.

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

Similar Threads

  1. Continuous Form colors
    By cl3093 in forum Forms
    Replies: 8
    Last Post: 11-29-2010, 05:09 PM
  2. Replies: 1
    Last Post: 07-22-2010, 05:55 AM
  3. programming a continuous form?
    By Ferret in forum Programming
    Replies: 3
    Last Post: 05-30-2010, 04:51 PM
  4. set continuous form height
    By taylorosso in forum Forms
    Replies: 0
    Last Post: 08-31-2009, 05:26 AM
  5. Continuous Form
    By duckie10 in forum Access
    Replies: 13
    Last Post: 06-09-2009, 11:15 AM

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