By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,354 Members | 1,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,354 IT Pros & Developers. It's quick & easy.

A general "How would you code this" question.

P: n/a
I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.

I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)

I am not as familiar with code as I would like, but it seems I would
need something like this:

If option1 = this, and option2 = this, then the answer (field name
Result) = this

I know that looks stupid, but I am hoping to show you how I am
approching this in my head.

Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.

Thanks for any time you can give.

Nov 6 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a

"Brave" <br*********@yahoo.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
>I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.

I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)

I am not as familiar with code as I would like, but it seems I would
need something like this:

If option1 = this, and option2 = this, then the answer (field name
Result) = this

choosing the states and then submitting the form would give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?

You would need some sort of lookup table.
>
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.

Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.

Thanks for any time you can give.

Nov 6 '06 #2

P: n/a
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.

States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)

On Nov 6, 9:52 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in messagenews:11*********************@e3g2000cwe.goo glegroups.com...
I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?

You would need some sort of lookup table.


I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted text -
Nov 6 '06 #3

P: n/a

"Brave" <br*********@yahoo.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.

States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)

ok
well i would load the data into a database, but you can read straight from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?

On Nov 6, 9:52 am, "Slim" <m...@here.comwrote:
>"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.go oglegroups.com...
>I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?

You would need some sort of lookup table.


I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -

Nov 6 '06 #4

P: n/a
I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet

Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in messagenews:11**********************@e3g2000cwe.go oglegroups.com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.
States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?
On Nov 6, 9:52 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.goo glegroups.com...
I am hoping for a code example of how to do this, and hopefully it will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this information?
You would need some sort of lookup table.
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If you
could offer a sample of code, I'm sure I could use it as a template for
other projects. My idea is that this is just standard IF this THEN that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -
Nov 6 '06 #5

P: n/a
Hmmm. For connecting to Access, you are better off using the OLEDB driver
rather than the ODBC driver in your example

Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;

Excel is pretty much the same:

Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Fullpath\MyExcel.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=1"""

HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if you
want to write to the worksheet.

sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
Notice that the worksheet name is followed by a $ sign.

--
Mike Brind
"Brave" <br*********@yahoo.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
>I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet

Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
>"Brave" <bravespl...@yahoo.comwrote in
messagenews:11**********************@e3g2000cwe.g ooglegroups.com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.
States are listed down the side and accross the top of the excel sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight
from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?
On Nov 6, 9:52 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.go oglegroups.com...
>I am hoping for a code example of how to do this, and hopefully it
will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing for
a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this
information?
>You would need some sort of lookup table.
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If
you
could offer a sample of code, I'm sure I could use it as a template
for
other projects. My idea is that this is just standard IF this THEN
that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -

Nov 6 '06 #6

P: n/a
Better still

I would upload my data into access, is there a reason for the data staying
in excel format?

"Mike Brind" <pa*******@hotmail.comwrote in message
news:eS**************@TK2MSFTNGP03.phx.gbl...
Hmmm. For connecting to Access, you are better off using the OLEDB driver
rather than the ODBC driver in your example

Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\somepath\mydb.mdb;

Excel is pretty much the same:

Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Fullpath\MyExcel.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=1"""

HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if
you want to write to the worksheet.

sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
Notice that the worksheet name is followed by a $ sign.

--
Mike Brind
"Brave" <br*********@yahoo.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
>>I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet

Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
>>"Brave" <bravespl...@yahoo.comwrote in
messagenews:11**********************@e3g2000cwe. googlegroups.com...

Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.

States are listed down the side and accross the top of the excel
sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight
from
the excel file also.

you need to make a connection to the data

then use a SQL query to select the answere and reder it to the client.

do you know how to make a connection to a excel sheet?

do you know how to make a SQL query?

On Nov 6, 9:52 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.g ooglegroups.com...

I am hoping for a code example of how to do this, and hopefully it
will
help me to see an easy way to code what seems to be a huge monster.

I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing
for a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)

I am not as familiar with code as I would like, but it seems I
would
need something like this:

If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form
would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this
information?

You would need some sort of lookup table.

I know that looks stupid, but I am hoping to show you how I am
approching this in my head.

Any ideas on how you would approch this project would be great. If
you
could offer a sample of code, I'm sure I could use it as a template
for
other projects. My idea is that this is just standard IF this THEN
that
coding, but I don't know the basics enough to create the code from
scratch.

Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -


Nov 8 '06 #7

P: n/a
No, my plan is to do it in access. I was just wondering about the
specifics. I'm assuming that functionality may come in handy on a
future project.

Thanks for everything.

On Nov 8, 12:12 pm, "Slim" <m...@here.comwrote:
Better still

I would upload my data into access, is there a reason for the data staying
in excel format?

"Mike Brind" <paxton...@hotmail.comwrote in messagenews:eS**************@TK2MSFTNGP03.phx.gbl. ..
Hmmm. For connecting to Access, you are better off using the OLEDB driver
rather than the ODBC driver in your example
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\somepath\mydb.mdb;
Excel is pretty much the same:
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Fullpath\MyExcel.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=1"""
HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if
you want to write to the worksheet.
sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
Notice that the worksheet name is followed by a $ sign.
--
Mike Brind
"Brave" <bravespl...@yahoo.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
>I have done some simple update queries, but nothing very advanced. I
have never connected to an excel sheet
Here is an example of a connection to an MS Access db I did. Would it
structure itself in a similar way?
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=\\*********Path to database*******.mdb;"
mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
Conn.Execute(mySQL)
Conn.Close
Set Conn = Nothing
%>
On Nov 6, 11:39 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11**********************@e3g2000cwe.g ooglegroups.com...
Thanks for the reply. I will be given an excel sheet that shows (much
like looking at a map) what courier is used.
States are listed down the side and accross the top of the excel
sheet.
(exp: Ohio and Maine = UPS)ok
well i would load the data into a database, but you can read straight
from
the excel file also.
>you need to make a connection to the data
>then use a SQL query to select the answere and reder it to the client.
>do you know how to make a connection to a excel sheet?
>do you know how to make a SQL query?
On Nov 6, 9:52 am, "Slim" <m...@here.comwrote:
"Brave" <bravespl...@yahoo.comwrote in
messagenews:11*********************@e3g2000cwe.go oglegroups.com...
>I am hoping for a code example of how to do this, and hopefully it
will
help me to see an easy way to code what seems to be a huge monster.
I need to create a form that has two pulldown menues (field names
Option1 and Option2). Each will house a list of the 50 U.S. States.
Users would then be able to choose two states, and get a listing
for a
courier used for pickup\deliveries (exp: My order is in Ohio, but I
need it delivered to Maine. Who do I use?)
I am not as familiar with code as I would like, but it seems I
would
need something like this:
If option1 = this, and option2 = this, then the answer (field name
Result) = thischoosing the states and then submitting the form
would
give you the 2
values. that is the easy part.
Now how do you expect to select the best courier from this
information?
>You would need some sort of lookup table.
I know that looks stupid, but I am hoping to show you how I am
approching this in my head.
Any ideas on how you would approch this project would be great. If
you
could offer a sample of code, I'm sure I could use it as a template
for
other projects. My idea is that this is just standard IF this THEN
that
coding, but I don't know the basics enough to create the code from
scratch.
Thanks for any time you can give.- Hide quoted text -- Show quoted
text -- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
Nov 8 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.