Question:
who can help me in my microsoft access database project that needs some visual basic application knowledge?
yolly jr f
2008-09-28 02:55:40 UTC
my project is about making a computerized payroll procedure. i am currently making it using microsoft access. now, i want to create an enabled property in a form where a field label: [Regular] is set in Yes/No: yes, for regular employees; no, for sub contractual workers. the data is stored using a different form. in this form(separate form) i have right now, it automatically fills that field and it works the way i want it. some field depends on whether an employee is a regular or not. if he's regular, you need to put his regular rate. if not, just leave it unfilled. but to help my user not to commit mistake in input, i want set the enabled to "no" then when a form field [Regular] is set to "yes" for an input of a regular employee, it will enable the field. how can i do that? i tried validation rule but it makes error.
Four answers:
expertaziz
2008-09-28 03:16:43 UTC
In Current Event of form i.e. right click outside of your form then select Properties. Scroll down to Current event click ellipse (i.e. ...) and select event procedure. It will open VBA editor. you will find



Private Sub Form_Current



End Sub



befor end sub type following code



If Me.Regular = True Then

Me.urfield1.Locked = True 'You can use Enable=False also

Me.urfield1.Locked = True 'But I prefer to use Lock

End If
?
2016-10-18 11:08:11 UTC
'ADO Connection Dim MyCon As New ADODB.Connection Dim MyRs As New ADODB.Recordset inner maximum Sub Form_Load() MyCon.Open "service=microsoft.jet.oledb.4.0;records source=c:a.mdb" 'a is the call of the database arranged in MS-get admission to MyRs.Open "choose * from b", MyCon, adOpenDynamic, adLockOptimistic 'b is the call of the table interior the database a end Sub Create a clean database in MS-get admission to and notice no rely if the above connection works this could be a ADO Connection you're able to desire to characteristic reference"Microsoft ActiveX records products 2.0 library" (undertaking--References) in any different case it won't paintings
anonymous
2008-09-28 03:16:28 UTC
put an if else staement there



if label1.caption ="regular" then (whatever ctrl.enabled = true or false)



Actually iam not getting your question !! You can mail me the code and i will fix it and send it to you for free that would help you and even my vb skill would be refreshed .else you can give a detailed step by step details explaining your problem above or can mail me at deepak_rege@yahoo.com or on messenger I can help you .
anonymous
2008-09-28 03:03:46 UTC
using VBA Application



using Google Search "VBA Access"


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...