Lifelesspeople.com

 Forum FAQsForum FAQs  KnowledgebaseKnowledgebase  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

access, forms and data  Share

 
Lifelesspeople.com Forum Index -> Techy Turf
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Princess of Jupiter


Joined: 11 Jun 2005
Posts: 3098
Location: Around Somewhere

PostPosted: Mon May 18, 2009 10:26 am    Post subject: access, forms and data Reply with quote

I'm using Access 2007. I've created a form (frmaddmember)
I'm now trying to refer to a field on the form in the vb code. Now my vb is a bit rusty, haven't used it in a while so its possible things have changed since i last used it

I've tried several variations of doing it
Code:
Dim fname As String
    fname = frmaddmember.FirstName

or
Code:
Dim fname As String
    fname = frmaddmember.FirstName.Text


produces
Quote:
Run-time Error '242':
Object required


If i use
Code:
Dim fname As String
    fname = FirstName.Text

i get
Quote:
Run-time Error '2185':
You can't reference a property or method for a control unless the control has focus


Any know how its supposed to be done?

In the end its going to go into an sql statement
_________________
Midnight Tempest - A Sailor Moon TCG
Calona - an adoptables site
Top Tycoons - Coming soon
My Stories
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Techy Turf All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com