Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 35
  1. #16
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    DLDB.zip
    Attached is my Access Database.

  2. #17
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    I will be back on around 8A.M. CST Tomorrow I will get your reply and see about it tomorrow. Thanks.

  3. #18
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    How do you manage to run code in this database? When I try to open the progress bar form, I get error message that code must be updated for use on 64-bit systems. I've been getting this a lot this week. Review http://support.microsoft.com/kb/983043

    I fixed that line and now I get "Method or data member not found". Status is not a label control it is a textbox. Textbox does not have a Caption property, label has Caption property, textbox has Value property. So change the code or change to a label. The code references controls named L1, L2, L3, L4, L5 which don't exist. The controls are named L6, L7, L8, L9, L10, L11, L12, L13. Now the code runs so fast can't even see the changes on form. But I disabled the code to run queries.

    So what form and code have you been running that 'does nothing' because it sure does a lot for me - not a lot of good but a lot.

    What is purpose of tblProgress? Why is form bound to this table?

    When you turn off warnings at beginning of a procedure, should turn them back on at end. If you use CurrentDb.Execute then don't have to bother with SetWarnings.

    Let me know if you still need help after cleaning up code.
    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.

  4. #19
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    I think Im done with this I think I will just look at it another day I guess.

  5. #20
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    Okay I am back sorry I just want to figure this out now I have done it a different way this time and need someone to analyze this code for me.
    Private Sub Command712_DblClick(Cancel As Integer)


    Dim db As Database
    Dim rs As Recordset

    Dim lngTotalRecord As Long
    Dim lngRecord As Long
    Dim x

    Set db = CurrentDb
    Set rs = db.OpenRecordset("SELECT * FROM trnrritem")

    If rs.RecordCount & gt; 0 Then
    DoCmd.OpenForm "sysStatusBar"
    rs.MoveFirst
    lngTotalRecord = 1
    Do Until rs.EOF
    rs.MoveNext
    lngTotalRecord = lngTotalRecord + 1
    Loop

    rs.MoveFirst
    lngRecord = 1
    Do Until rs.EOF
    updateWarehouseInventory rs!itemID, intWarehouseId, strBatchNumber, rs!BaseUnitCost

    Forms!sysStatusBar!percentage = Trim(Str(Int((lngRecord / lngTotalRecord) * 100))) & "% Complete"
    Forms!sysStatusBar!Box2.Width = Int(Forms!sysStatusBar!box1.Width * (lngRecord / lngTotalRecord))
    Forms!sysStatusBar.Repaint

    rs.MoveNext
    lngRecord = lngRecord + 1
    x = DoEvents
    Loop

    DoCmd.Close acForm, "sysStatusBar"
    End If
    db.Close
    Set db = Nothing


    End Sub

    When Running this code I get syntax errors, as shown in red.
    And if there is a cleaner way to set the code up please allow me to accept that code.

  6. #21
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    What is supposed to be in place of >? Maybe:

    If rs.RecordCount <> 0 Then

    Why do you loop through recordset and do nothing with any fields? Maybe just do:
    lngTotalRecord = rs.RecordCount

    Why bother with Str() and Trim() functions?

    I presume &amp; should just be &.
    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.

  7. #22
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    I found this code at
    http://hgminerva.wordpress.com/2011/...s-application/
    Can you rewrite the code and send it to me and I will try it???

  8. #23
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    I have thought about it and I think I have got a better way to do it but I just wish I could figure this out okay I kind of tried to think about an If Then statement but I need someone that knows the code to write it for me I have this currently as my status bar. . .
    Click image for larger version. 

Name:	status bar.JPG 
Views:	11 
Size:	19.8 KB 
ID:	17085
    It consists Of two boxes one for the background and the other for the status both their names are box1 and box2
    I also have a text box in the center that is unbound and currently this is just a form but hopefully with your assistance my idea could unwrap itself

    My idea:
    Button On Click Command

    If status (txt box) says "Status: 0%"
    Then box2.width = 0
    end If
    box2.width + 1
    If box2.width = 1
    Then status (txt box) says "Status: 10%"
    end If
    box.width + 1
    If box2.width = 2
    Then status says "Status: 20%"

    . . . . . . .
    And so on until
    If box2.width = 2
    Then Cmd.Close <------Close Form

    End Sub

  9. #24
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Your latest version doesn't make sense.

    Did you try the edits I suggested for the looping code?

    Why didn't you stick with the original code I reviewed in post 18. It does work with the edits I described.
    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.

  10. #25
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    I have tried both the suggestions and neither of them work for me sorry
    I can assure you that this one seems way easier to me Look at this Post here. . . . . .
    http://hgminerva.wordpress.com/2011/...s-application/
    That is where I got the easier version but I still don't understand how I could build the second part of the coding he provided can you use this updated download of my database and try it and send me the code?
    DLDB.zip
    the form is called frmProgress

  11. #26
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    I still get the 64-bit error when opening db.

    Did you run Debug>Compile on your code? I did and it errors in several places - 'Method or data member not found'. This is really annoying during debug efforts. I quit your db and did a little test in one of my own with the following which works great.

    Code:
    Private Sub Form_Load()
       Me.Box1.Width = 5200
       Me.Box2.Width = 0
       Me.Percentage = "0% Complete"
       ProgressBar
    End Sub
    
    Public Sub ProgressBar()
    Dim lngTotalRecord As Long
    Dim lngRecord As Long
    Dim x
    lngTotalRecord = 10
    lngRecord = 1
    For i = 1 To lngTotalRecord
        Start = Timer
        While Timer < Start + 1
            DoEvents
        Wend
        Me.Percentage = Trim(Str(Int((lngRecord / lngTotalRecord) * 100))) & "% Complete"
        Me.Box2.Width = Int(Me.Box1.Width * (lngRecord / lngTotalRecord))
        Me.Repaint
        lngRecord = lngRecord + 1
    Next
    End Sub
    Last edited by June7; 07-02-2014 at 11:40 PM.
    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.

  12. #27
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    Did you put all this code under the Form_Load?

  13. #28
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    what all did you have to make just the form and a table or just form with code inside?

  14. #29
    Z1nkstar's Avatar
    Z1nkstar is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    TX, USA
    Posts
    145
    This is what I have come up with and now All it does is when I hit the button to open the form then all I get is a belay then it opens but shows 100% Complete and you couldn't see that it goes from 10% to 100% . . . .
    Code:
    Private Sub Command714_Click()
    
    DoCmd.OpenForm "sysStatusBar", acNormal
    
    
    'DoCmd.RefreshRecord
    
    
    End Sub
    Code:
    Private Sub Form_Load()
        box1.Width = 5200
        Box2.Width = 0
        percentage = "0% Complete"
        sysStatusBar
    End Sub
    Public Sub sysStatusBar()
    
    
    Dim lngTotalRecord As Long
    Dim lngRecord As Long
    Dim x
    lngTotalRecord = 10
    lngRecord = 1
    For i = 1 To lngTotalRecord
        Start = Timer
        While Timer < Start + 1
            DoEvents
        Wend
        Me.percentage = Trim(Str(Int((lngRecord / lngTotalRecord) * 100))) & "% Complete"
        Me.Box2.Width = Int(Me.box1.Width * (lngRecord / lngTotalRecord))
        Me.Repaint
        lngRecord = lngRecord + 1
    Next
    
    
    End Sub
    Click image for larger version. 

Name:	02315464641213.jpg 
Views:	8 
Size:	220.3 KB 
ID:	17107
    Click image for larger version. 

Name:	00020202200202020002020200020202010101000000.jpg 
Views:	8 
Size:	161.0 KB 
ID:	17108
    Click image for larger version. 

Name:	1235648979889522222222.JPG 
Views:	8 
Size:	124.7 KB 
ID:	17109

  15. #30
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    I have the timer code in there so I can see the progress bar change. I used this because I didn't want to create code that really does something, like run queries. It works for me. Try a higher number.

    Start + 10
    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.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to Implement??
    By radick201 in forum Database Design
    Replies: 3
    Last Post: 01-15-2012, 02:02 AM
  2. implement expressions
    By quandore in forum Access
    Replies: 7
    Last Post: 01-11-2012, 03:48 AM
  3. Implement Forms Only on Start Up
    By fat ralphy in forum Forms
    Replies: 5
    Last Post: 10-21-2011, 02:08 PM
  4. How would I implement this?
    By redfox1160 in forum Access
    Replies: 4
    Last Post: 03-09-2011, 03:07 PM
  5. Finalise database and implement??
    By turbo910 in forum Access
    Replies: 4
    Last Post: 12-12-2009, 04:28 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