Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397

    Unanswered: Converting Access db from 2K3 to 2K7 - Issues

    Hi,

    I just started working with Access 2007 and need to learn more. I converted my 2003 db (with save as option) to 2007 and find difficulties to run my forms in it.

    I have few querries.

    1. Can somebody tell me how can I reduce size of my textbox field on from.

    In Access 2003, I could able to just select the text box and reduce it but in this new version of if I am trying to do this...all the other text boxes are being selected and reduced..which I dont want.

    2. I found my previouse VBA codelines of Event procedures of I had in 2003 are not responding. When I look the properties of new form/(s), the shape has been changed. Here I want to ask one thing..will my previous code like 'Select * from tbl where........' will work or do I need to modify...or what..

    Please advise...
    With kind regards,
    Ashfaque

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    1. I think this is the result of the ability to group controls to work with them all without having to re-select them. You just need to select your group and ungroup the objects. You do that by clicking the Ungroup button on the Arrange tab of the ribbon.

    2. Not sure what you mean by some code not responding; that could mean anything... nor do I know what you mean by your forms are a different shape. However, basic SQL code (and all cleanly written code) will transfer across with no problem, so your SELECT statements will be fine.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Thanks ST.

    The first one is done.

    But with regards to code...I am still facing prob.

    Why the codes are not working.

    One of the bound text box I have Afterupdate event with below code. The code was perfect in 2003 but not responding in 2007.

    If DCount("*", "T_AccountMaster", "AccCode= FORMS!F_Account_Master!AccCode") Then
    MsgBox "SALESMAN NUMBER ALREADY EXIST..", 294, "Duplication !!!"
    Me.Undo
    AccCode = Null
    Me.AccNewCode.SetFocus
    Me.AccCode.SetFocus
    Exit Sub
    MsgBox "PRESS ESC...TO CONTINUE WITH NEW ENTRY", vbInformation, "PertominOIl..."
    Else
    End If

    Thinking the Dcount function might not be working, I have changed to below withc is working in 2K3 but not in 2K7 (I just retyped the code belwo - not copied as the original code is at my home)

    Dim db as DAO.Database
    Dim rst as DAL.Recordset
    Set rst=db.openrecordset("Select * from T_AccountMaster where AccCode=" & FORMS!F_Account_Master!AccCode
    If rst.BOF and rst.EOF then
    rst.AddNew
    .....
    .....
    rst.update

    else
    Msgbox"Already Exist"
    rst.close
    set rst=nothing

    Nothing happening while execution...I placed toggle even to see whats going on but no use...

    Please extend your help..
    With kind regards,
    Ashfaque

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Thinking the Dcount function might not be working
    Firstly, you need to lose the "I think" part. You have to identify a problem before starting to try to fix it.

    Nothing happening while execution...I placed toggle even to see whats going on but no use...
    Is Access executing the code at all?

    Is [Event Procedure] in the After Update property for the text box being addressed here. When you press the build button, does it take you to the right code?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Is Access executing the code at all?
    This is what for I placed my question here..

    Off course it takes cursor to the right event code area but even after placing toggle to the codeline, I can not trace out where is the error and why the code is not being executed. No action....

    One more thing...instead of [Even Prodedure], I found in 2K7 [Event pro...Macro].

    Sheet is apprearing for in-built code and these in-built code like Close form etc are working fine but how about the my previous code? How can i write it here...? Bcz it is written in VBA...
    With kind regards,
    Ashfaque

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ashfaque - have a read up on VBA debugging, especially setting Breakpoints, Stepping through Code, using the Immediate Window. You really need as a developer to be able to differentiate between code being executed and code not being executed. Stepping through the code will identify EXACTLY where things are going wrong. Without knowing that you will waste lots of time on irrelevencies.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I think he's saying that he can't do that because the code never executes.

    instead of [Even Prodedure], I found in 2K7 [Event pro...Macro]
    See now that sounds like a significant problem. Can you change it to [Event Procedure] ?

    Other than that, I'd be starting to suspect significant corruption and I'd be trying things like re-building the form or creating a new database and importing all the objects into it. I certainly haven't run into a [Event pro...Macro] indicator being available. It's either [Event Procedure] for VBA or <NameOfMacro> for macros.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'd want to make sure the code is actaully associated with the event hook in the form.. this is a quite common problem for Access code, espcecailly when the code is put into the VBA editor without going through the form designer.

    However I don't use A2007 so I don't know if it is still a problem (it has been since V2.. so I'd guess its likely)

    I'd want to go into the form designer, view the properties, check the even tab and make sure there is some code associated with the expected event hook. probably by selecting the event and pressing the code option. Thats if my memory serves me right... Im sitting here in a non Access box so I cnat' check the procedure
    I'd rather be riding on the Tiger 800 or the Norton

  9. #9
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    ^^ I think we just covered that

    Quote Originally Posted by ST
    When you press the build button, does it take you to the right code?
    Quote Originally Posted by Ashfaque
    it takes cursor to the right event code area
    I've never known any Access database to NOT run code when this happens.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  10. #10
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    isnt A2007 more sniffy about how you refer to objects, I know .NET no longer allows default properties, so mebbe you have to expclicity define which object property you want to use.. which is no bad thing with eearlier Access db's

    but this doens't look right to me
    Code:
    If DCount("*", "T_AccountMaster", "AccCode= FORMS!F_Account_Master!AccCode")
    I would have expected something like
    Code:
    If DCount("*", "T_AccountMaster", "AccCode= " & FORMS!F_Account_Master!AccCode)
    OR
    Code:
    If DCount("*", "T_AccountMaster", "AccCode= " & FORMS!F_Account_Master!AccCode.value)
    assuming it was a numeric columns
    or, for string/text columns
    Code:
    If DCount("*", "T_AccountMaster", "AccCode= " & chr$(34) &  FORMS!F_Account_Master!AccCode) & chr$(34)
    OR
    Code:
    If DCount("*", "T_AccountMaster", "AccCode= "  & chr$(34) & FORMS!F_Account_Master!AccCode.value) & chr$(34)
    Id agree that its highly unlikely that code is going to the section and selectively not running.
    I's agree that learning the basics of debugging is a smart move
    I'd want to put some code in the else section if I felt the dcount wasn't returning some values.
    I wonder if mebbe there is some global error handler active, or if warnings are set off. both of those could cause the code to run in a stealth mode, where an error occurs but there is no apparent error reported.
    I'd rather be riding on the Tiger 800 or the Norton

  11. #11
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    ▲ Agreed.

    Except Access 2007 is as forgiving as 2003 when it comes to default arguments. It has to otherwise every 2003 database out there wouldn't convert to 2007 cleanly.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •