Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

form population macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pam - 15 Sep 2007 05:02 GMT
I have a dilema, I have one form that is filled out with basic info that
needs to download into two other forms and then save to a pdf.
I can get the general form, and protect it, but am having problems with the
logistics of the other functions.
For instance, I have
Customer Name
Customer Number
Work order Number
Qty
Part Number
Sales Amount
Wholesale Amount
etc....
The one form goes to the supplier, so it needs wholesale dollars on it, and
the other form goes to the office, so it needs sales dollars on it.
All of this needs to be iron clad so that the information changes UNLESS the
credit card has already been processed.
I have been working on this awhile, but am hitting a blank wall, any
suggestions on where to start?
Thanks
Joel - 15 Sep 2007 12:04 GMT
It is hard to give you additional information.  It seems that you know how to
generate a form.  You have one and it is already working.   You should be
able to generate two additional forms.  Copying the data from one form to
another is not different than copying data from one worksheet to another
worksheet.  Is this where you problem lies?

sheets("Sheet2").range("C5").value = sheets("Sheet1").range("A1").value

Forms names are the names on the tabs at the bottom of the worksheet which
are the same as sheet names.

> I have a dilema, I have one form that is filled out with basic info that
> needs to download into two other forms and then save to a pdf.
[quoted text clipped - 16 lines]
> suggestions on where to start?
> Thanks
Pam - 16 Sep 2007 01:36 GMT
Well, I have the vba form done, but don't know how to call it into the excel
spreadsheet.  That's probably the simplest thing to do, I know, but I've been
away from this for a long time.
The other problem I'm having is I have a drop down list for credit cards,
that chooses, Visa, AE ...etc. and I want to have the entry cell change if it
is visa, or american express, since they have different amounts of digits,
and to confirm that they have entered the correct amount of digits.
I have the custom formating now for visa, but it will not work for american
express.
Sorry to be so dense on this. :(

> It is hard to give you additional information.  It seems that you know how to
> generate a form.  You have one and it is already working.   You should be
[quoted text clipped - 27 lines]
> > suggestions on where to start?
> > Thanks
Joel - 16 Sep 2007 07:26 GMT
Pam: I answer the qustion below in the row with the dashed lines (2 places).

Well, I have the vba form done, but don't know how to call it into the excel
spreadsheet.  That's probably the simplest thing to do, I know, but I've been
away from this for a long time.

--------------------------------------------------
The VBA userform from a macro is called by

userform1.Listbox1.clear
userform1.show

The listbox will keep previous contants so you need to clear it before you
open it.

You can change the name in VBA by going to view menu adding property window
to VBA.  then in the Project window select form - userform1. Changing name to
Creditform will then change the name in VBA to CredFrom.show.

You may also want to change the caption.

-----------------------------------------------------

The other problem I'm having is I have a drop down list for credit cards,
that chooses, Visa, AE ...etc. and I want to have the entry cell change if it
is visa, or american express, since they have different amounts of digits,
and to confirm that they have entered the correct amount of digits.
I have the custom formating now for visa, but it will not work for american
express.
Sorry to be so dense on this. :(

--------------------------------------------------------
I having trouble figuring out what you are doing.  The same things can be
done in both VBA code and in the spreadsheet and the answer will be
completely different depending on which method is used.  Sometimes there is
multiple way of doing things in both.

I think you are using for the drop down list Data Validation List.  Not sure
why custom formating will not work on a spreadsheet (you may be using a
different method).  A spreadsheet from will accept any number of characters
or digits?  If you are using a data validation you can set the number of
digits to between and make it the length between both numbers.

Sorry If I'm not understanding which methods you are using.
--------------------------------------------------------

"Joel" wrote:

> It is hard to give you additional information.  It seems that you know how to
> generate a form.  You have one and it is already working.   You should be
[quoted text clipped - 28 lines]
> > suggestions on where to start?
> > Thanks

> Well, I have the vba form done, but don't know how to call it into the excel
> spreadsheet.  That's probably the simplest thing to do, I know, but I've been
[quoted text clipped - 38 lines]
> > > suggestions on where to start?
> > > Thanks
Pam - 16 Sep 2007 20:02 GMT
Thanks Joel,
I'll try to be clearer on the credit card number issue.  I think I need to
use an if statement.  I want it to be if, visa/mastercard then 16 digits, if
american express then 15 digits. but since I'm using a drop down list for the
choices of visa, mastercard, discover or american express I can't get an if
statement to work because it comes up with an error?

> Pam: I answer the qustion below in the row with the dashed lines (2 places).
>
[quoted text clipped - 119 lines]
> > > > suggestions on where to start?
> > > > Thanks
Joel - 16 Sep 2007 22:28 GMT
I posted a response about 1 hour ago and haven't seen the listing.  Here is
my response

It is better if you split a complicated IF stateemnt into smaller pieces.  I
used 2 IF statements to test for the lenght of the credit card number.

Sub test()
'Cell A1 contains drop down list selection
If Range("A1") = "American Express" Then
  CCNumber = 15
Else
  CCNumber = 16
End If

If Len(EnteredNumber) <> CCNumber Then
  MsgBox ("Invalid Credit Card Number")
Else

  'enter you code here
End If
 
End Sub

> Thanks Joel,
> I'll try to be clearer on the credit card number issue.  I think I need to
[quoted text clipped - 126 lines]
> > > > > suggestions on where to start?
> > > > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.