Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 4th, 2008, 02:14 PM
Registered User
 
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA code not triggeres

Hello,

I am having to develop a simple access based UI application. I have placed all controls, named them and also wrote code for form load and a button click event. However, when the form loads, the load event is not triggered. It was working earlier. I am not sure what I did but now, none of the events are recognized. No errors are displayed either. can someone help pls? This is urgent. Thanks a ton for your replies.

The following is the code under form load event -

Private Sub Form_Load()
    'Setting fields to empty

    AppList.Value = ""
    AppManager.Value = ""
    BOAReqNum.Value = ""
    InfyReqNum.Value = ""
    BusCritical.Value = False
    CloseDay.Value = ""
    CloseMonth.Value = ""
    CloseYear.Value = ""
    CurrStatus.Value = ""
    ReqType.Value = ""
    IncidentRole.Value = ""
    ReqDesc.Value = ""
    ResolDesc.Value = ""
    RootCauseDesc.Value = ""
    NegProdImpactDesc.Value = ""
    ProdIssue.Value = False
    RespSev.Value = ""
    RestSev.Value = ""
    FinalSev.Value = ""
    Priority.Value = ""
    RCACat.Value = ""
    LOCForEnh.Value = ""
    ProdImplType.Value = ""
    OpenMonth.Value = ""
    OpenDay.Value = ""
    OpenYear.Value = ""
    OpenTime.Value = ""
    TransferMonth.Value = ""
    TransferDay.Value = ""
    TransferYear.Value = ""
    TransferTime.Value = ""
    CloseMonth.Value = ""
    CloseDay.Value = ""
    CloseYear.Value = ""
    CloseTime.Value = ""
    ProdRespTime.Value = ""
    ProdRecTime.Value = ""
    ProdResolutionTime.Value = ""
    EstMonth.Value = ""
    EstDay.Value = ""
    EstYear.Value = ""
    ActMonth.Value = ""
    ActDay.Value = ""
    ActYear.Value = ""
    EstEftHrs.Value = ""
    ActEftHrs.Value = "'"
    PreMonEftHrs.Value = ""
    EstImprovement.Value = ""
    ActImprovement.Value = ""
    PassAccept.Value = False
    NegProdImpact.Value = ""
    AppList.SetFocus
End Sub
 
Old May 15th, 2008, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Welcome to Wrox!

There is nothing in your code that would make it evident whether it's firing or not. All you're doing is setting textboxes, comboboxes, and checkboxes to empty strings or false.

This is not really necessary because

1) when you designed your tables, your yes/no fields could have been set to FALSE as default initial value there.

2) As for the textboxes and comboboxes, if you don't set them at all, their default values are NULL. You set them to empty strings "" which is not the same thing. Ideally, if you didn't set a textbox to some value, you WANT it to be null.

Therefore, from my limited understanding of what your form does, that whole load procedure is totally unnecessary (see 1) or even problematic (see 2).


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
vba code need in.ssuresh Excel VBA 2 November 29th, 2005 08:40 PM
vba code in.ssuresh Excel VBA 1 November 28th, 2005 05:10 AM
Help with VBA Code KevinN Excel VBA 1 April 22nd, 2005 06:50 AM
VBA code desprate Access VBA 7 April 12th, 2005 08:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.