Selasa, 11 Desember 2012

Re: [ExcelVBA] Userform in excel 2010

 

Your code has been quite corrupted by your e-mail. Once I insert returns
into it, I see four separate copies of the same 8 assignment statements.
There is also a small cmdOK_Click() sub.

You say it highlights "Me.txt", but that occurs many times in the code
you've posted. Exactly which one is it?

Also, it's odd that this is all that is highlighted. For instance, if I
copy the sub into a form and try the compilation (Excel 2003), the highlight
is on the line

If Me.txtFirstName.Value = "" Then

and covers ".txtFirstName".

If the highlight is stopping at the end of the ".txt", then it sounds as
though you might have a space after the ".txt" and before the remainder of
the name.

Have another go at copying your code, but make sure that your message is
plain text first. And also please indicate exactly which statement it
doesn't like.

Are you sure that you have text boxes named exactly as you have them in the
code? txtdate, txtname, txtMICostCenter, txtProjectName,
txtSuppliertocharge, txtResponsiblPerson, txtCostCenter, txthours,
txtFirstName

Note that you have txtname and also txtFirstName
Also note the misspelling in txtResponsiblPerson

Regards, Dave S

----- Original Message -----
From: "beverley sterling" <beezsting@yahoo.com>
To: <ExcelVBA@yahoogroups.com>; "Group - Word_VBA"
<Word_VBA@yahoogroups.com>; <MSO_2007@yahoogroups.com>;
<MSO_2010@yahoogroups.com>; <MSO365@yahoogroups.com>;
<MS-Word@yahoogroups.com>; <Outlook_Advanced@yahoogroups.com>;
<Word_DocDesign@yahoogroups.com>
Sent: Tuesday, December 11, 2012 3:16 PM
Subject: Re: [ExcelVBA] Userform in excel 2010

>I have been trying to setup a userform in excel 2010, but when I write the
>VBA for the command OK button, I keep getting an error Compile error -
>method or data member not found, I am not sure why. the error keeps
>highlighting "Me.txt"Below are the two codes which I tried, on two
>different forms, and keep getting the same error.Thanks very much for your
>response.
> 'copy the data to the databasews.Cells(iRow, 1).Value =
> Me.txtdate.Valuews.Cells(iRow, 3).Value = Me.txtname.Valuews.Cells(iRow,
> 4).Value = Me.txtMICostCenter.Valuews.Cells(iRow, 6).Value =
> Me.txtProjectName.Valuews.Cells(iRow, 7).Value =
> Me.txtSuppliertocharge.Valuews.Cells(iRow, 10).Value =
> Me.txtResponsiblPerson.Valuews.Cells(iRow, 11).Value =
> Me.txtCostCenter.Valuews.Cells(iRow, 12).Value = Me.txthours.Value
> Private Sub cmdOK_Click()If Me.txtFirstName.Value = "" ThenMsgBox "Please
> enter a First Name.", vbExclamation, "Project
> Information"Me.txtFirstName.SetFocusExit SubEnd IfEnd Sub__,_._,_
> ithe data to the databasews.Cells(iRow, 1).Value =
> Me.txtdate.Valuews.Cells(iRow, 3).Value = Me.txtname.Valuews.Cells(iRow,
> 4).Value = Me.txtMICostCenter.Valuews.Cells(iRow, 6).Value =
> Me.txtProjectName.Valuews.Cells(iRow, 7).Value =
> Me.txtSuppliertocharge.Valuews.Cells(iRow, 10).Value =
> Me.txtResponsiblPerson.Valuews.Cells(iRow, 11).Value =
> Me.txtCostCenter.Valuews.Cells(iRow, 12).Value = Me.txthours.Value'copy
> the data to the databasews.Cells(iRow, 1).Value =
> Me.txtdate.Valuews.Cells(iRow, 3).Value = Me.txtname.Valuews.Cells(iRow,
> 4).Value = Me.txtMICostCenter.Valuews.Cells(iRow, 6).Value =
> Me.txtProjectName.Valuews.Cells(iRow, 7).Value =
> Me.txtSuppliertocharge.Valuews.Cells(iRow, 10).Value =
> Me.txtResponsiblPerson.Valuews.Cells(iRow, 11).Value =
> Me.txtCostCenter.Valuews.Cells(iRow, 12).Value = Me.txthours.Value'copy
> the data to the databasews.Cells(iRow, 1).Value =
> Me.txtdate.Valuews.Cells(iRow, 3).Value = Me.txtname.Valuews.Cells(iRow,
> 4).Value =
> Me.txtMICostCenter.Valuews.Cells(iRow, 6).Value =
> Me.txtProjectName.Valuews.Cells(iRow, 7).Value =
> Me.txtSuppliertocharge.Valuews.Cells(iRow, 10).Value =
> Me.txtResponsiblPerson.Valuews.Cells(iRow, 11).Value =
> Me.txtCostCenter.Valuews.Cells(iRow, 12).Value = Me.txthours.Value
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
> here: http://www.mousetrax.com/techtrax to enter the ezine, then search
> the ARCHIVES for EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>
>
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1427 / Virus Database: 2634/5448 - Release Date: 12/09/12
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar