473,511 Members | 15,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Basic Question and Help

26 New Member
Here is what I am trying to do I have a spreadsheet that has the column headings of song title, album name, artist name, and genre. I am trying to write a procedure that prompts the user to enter the number of songs to enter into the list and then loops through a repetition structure to obtain the song title, album name, artist name, and the genre. The structure adds this information to the appropriate rows, beginning with Row 5, in columns A, B, C, and D.

Here is what I have so far can anyone help

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim counter, numSongs As Integer
  3. numSongs = Val(InputBox("Enter the number of songs"))
  4. counter = 1
  5. While counter <= numSongs
  6.     Row(counter + 5).Column(A) = InputBox("Enter the Title")
  7.     Row(counter + 5).Column(B) = InputBox("Enter the Album Name")
  8.     Row(counter + 5).Column(C) = InputBox("Enter the Artist Name")
  9.     Row(counter + 5).Column(D) = InputBox("Enter the Genre")
  10. Loop
  11.  
  12.  
Am I on the right track and also when I try to compile it, it says "invalid outside procedure" and it hightlights the "Enter number of songs"
Jun 30 '07 #1
1 1110
Daine
12 New Member
Here is what I am trying to do I have a spreadsheet that has the column headings of song title, album name, artist name, and genre. I am trying to write a procedure that prompts the user to enter the number of songs to enter into the list and then loops through a repetition structure to obtain the song title, album name, artist name, and the genre. The structure adds this information to the appropriate rows, beginning with Row 5, in columns A, B, C, and D.

Here is what I have so far can anyone help

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim counter, numSongs As Integer
  3. numSongs = Val(InputBox("Enter the number of songs"))
  4. counter = 1
  5. While counter <= numSongs
  6.     Row(counter + 5).Column(A) = InputBox("Enter the Title")
  7.     Row(counter + 5).Column(B) = InputBox("Enter the Album Name")
  8.     Row(counter + 5).Column(C) = InputBox("Enter the Artist Name")
  9.     Row(counter + 5).Column(D) = InputBox("Enter the Genre")
  10. Loop
  11.  
  12.  
Am I on the right track and also when I try to compile it, it says "invalid outside procedure" and it hightlights the "Enter number of songs"
If that is your complete code then you need to put it inside a sub or function.

Example:
Private Sub subname()

Code

End Sub

Use a function instead of a sub if you are returning values.

If thats only a part of your code then I'm not sure.
Jul 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4214
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
5
2748
by: Bob Alston | last post by:
I am looking for any Microsoft Access based software that could be used for a United Way agency that provides basic needs assistance - food, clothing, financial (rent, utilities, Rx, gasoline,...
2
2290
by: Chad Beckner | last post by:
Hi everyone, I am developing a site in which the root will be set with Anonymous & Basic permissions. Past that I will have an application (directory) in which I will be developing...
0
1049
by: BobJones | last post by:
After inserting the third CD during the installation process, the program starts rolling back the installation and displays an error message. I am running Windows 2000 SP4, installing VB.Net from...
4
1279
by: Mark Linehan | last post by:
Greetings and salutations. I began programming God knows how many years ago in basic on the Commodore 64. I dabbled in a little assembly as well. I moved on to the PC eventually and stuck with...
13
15525
by: Pete | last post by:
I'm cross posting from mscom.webservices.general as I have received no answer there: There has been a number of recent posts requesting how to satisfactorily enable BASIC authorization at the...
5
3771
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems;...
13
3004
by: usenet | last post by:
How and where can one find out about the basics of VB/Access2003 syntax? I am a died in the wool C/C++/Java Linux/Unix programmer and I am finding it difficult to understand the program format...
4
3069
by: Chris Asaipillai | last post by:
Hi there My compay has a number of Visual Basic 6 applications which are front endeed onto either SQL Server or Microsoft Access databases. Now we are in process of planning to re-write these...
43
2344
by: Bill H | last post by:
25 years ago every computer came with some form of Basic interpreter so you could use yoru computer without having to buy more software. Is Javascript (teamed with HTML) set to become the new...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.