Can't Get Passed First Page!

Posted on 2003-03-15
Medium Priority
Last Modified: 2010-05-01
This is a basic( no pun) question, but it has my head wrecked!!
I have just started on VB and its my first attempt at programming
I Have a learning edition of VB, im trying to write a quiz type program ( hey there's
nothin on TV). I have my first page done, IE, What is blah blah, i have a lits of awnsers,
you pick one hit the enter button and are told it right ( or wrong) .
Now im stuck, how do i go on to the next question,i've tried looking up all the help menus
 i can get me eyes on , but im getting nowhere, i know its simple ( i hope).
Hope you can help,
Kitz E.
Question by:KitzEKat
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8144176
Well, it depends where your next question is.  If it is in a different frame, you can use the visible properties.

Frame1.visible = false
Frame2.visible = True

Or if it is a form you can do the same thing

Form1.visible = false
Form2.visible = True

I hope this helps.  I don't know if I quite understand what you are doing though.

Author Comment

ID: 8144219
EH thats a good question, what am i trying to do!!
Something along the lines of a simulated exam test ie A+
 type of thing, like i say i have the first "page" done, when you answer that question i want to be able to go on to the next one and so on ,do i do a different page or form for each one ? how do i make the "NEXT Question " button lead to an identical page with a different question,

Accepted Solution

robertlees earned 200 total points
ID: 8144381
Let's say you have stored your questions in a file called Questions.txt. Each question is on one line, and the answer is on the next line.

In Form_Load you write...
   Open app.path & "\Questions.txt" for input as #1
   call GetNextQuestion

Then write a routine...
Sub GetNextQuestion()
   dim strQ as string
   dim strA as string

   if eof(1) then
      msgbox "There are no more questions"
      Line Input #1,strQ
      line input #1,strA
   end if
End Sub

On your form you would have 2 textboxes - one called txtQuestion and the other txtAnswer. Also a command button call cmdReveal and one called cmdNext. Also cmdEnd

sub cmdReveal_Click
end sub

sub cmdNext_click
   call GetNextQuestion
end sub

sub cmdEnd_click
   close #1
end sub

That should do to get you started. You could add stuff like recording their answers, etc
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 8144395
Create two forms (named Form1 and Form2), with a button (Command1) on the first form, and put in this code in Private Sub Command1_Click:
'Insert here your code for testing if the answer is right
Form1.Hide 'you could also do Form1.Visible=False
Form2.Show 'you could also do Form2.Visible=True


Expert Comment

ID: 8144612
This isn't a proposed answer, but just a helpful bit of advice.

If you understand how, and the security of the actual answers is important, then I would suggest putting the questions and answers in a database.

There are many good reasons for doing this.  You don't have to work with files, and since the database is password protected, nobody can see the questions or the answers.


Author Comment

ID: 8144708
Thanks all.
Your advice is goin to put me on the right track, there's a bit more to this BASIC thing than i thought, thanks for your time, i will take your advice on board, it will take sometime to figure it all out, that's the fun bit!!!, but i know you have me on the right track,i may have skipped some of the basics and jumped in too deep, im like that!
Its the only way to fly!
So thanks you guy's for takin the time to help a newbie,
Take It Handy!
And Remember us cats have four paws, we can type fast!!
Just Don't Know what were typin, but hey its fun!!!
Kitz E Kat

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question