Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 7th, 2003, 03:31 AM
Authorized User
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default checkbox


how can i do checking (if else) under the control source properties of a field?

pls advice???:)

Reply With Quote
  #2 (permalink)  
Old October 7th, 2003, 05:23 AM
Authorized User
Join Date: Sep 2003
Location: Cambridge, , United Kingdom.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts

I not entirely sure if this is what you are asking (Tell me if I am wrong) however if I need to isolate the contents of a field for checking purposes I usually use
if me.fieldname= "Yourinfohere" then ...
in the Form_Current() method. This will isolate the context of the textbox/combobox being used. For check boxes use true/false as necessary.

Below are a couple of examples
<h3>example 1</h3>
If Me.Loggedin_txt = "Usernamehere" Then
    'If so then allow new users button
    Me.NewUser_btn.Visible = True
    Me.NewUser_lbl.Visible = True
End If
<h3> Example 2 checkboxes</h3>
If recClone.RecordCount = 0 Then
    MsgBox "There is no one to be billed this month"
    'If to see if the URL expiry is within next month, add to bill.
    If Me.NextRenewel_URL <= Date + 31 Then
        BillTotal = Me.CostPA
        BillTotal = 0
    End If
'more code here
End If
Alright it's crude, probably not the most efficient way of doing things, but it works. If anyone else reading this knows more efficient ways of checking data, please let me know.

If however you want to edit control source based on the contents of a text box try this (Once again crude, and almost certainly not totally efficient)
If Me.ClientName = "fhjk" Then
   Me.Text1.ControlSource = "= DomainName" 'Due to fact its a text field
   Me.Text1.ControlSource = "=" & ExtentionNumber 'not text field therefore no need
                                                  'for "..."
End If

David Thorne, Student
Reply With Quote
  #3 (permalink)  
Old October 10th, 2003, 03:25 AM
Authorized User
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts

okie thanks!!

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
checkbox grstad HTML Code Clinic 1 December 18th, 2006 08:10 AM
checkbox checked by default by html:checkbox sachin.tathod Struts 3 December 4th, 2006 03:41 PM
Need Help regards checkbox nellaikumar ASP.NET 1.0 and 1.1 Basics 1 December 1st, 2005 02:07 PM
checkbox fcm Access VBA 12 April 15th, 2005 08:15 AM
Checkbox johnjohn Classic ASP Basics 2 December 6th, 2004 06:03 PM

All times are GMT -4. The time now is 12:41 PM.

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