473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Running code in a Form

I have not been able to figure out how to run code in a form, before any
buttons are pushed/clicked. What I have is a recipe manager that "reads" an
access file to get recipe information. When a user first goes into it, they
should be displayed the 1st recipe in the database, but I am unsure how to
do this. I believe I can get that information if they click a button on the
form with the proper database read commands, but how do I tell VB to go
ahead and get that information for the 1st record BEFORE they click on
anything at all?

Jul 17 '05 #1
3 1717

"John Hrusovszky" <ja******@wctc.net> wrote
I have not been able to figure out how to run code in a form, before any
buttons are pushed/clicked. What I have is a recipe manager that "reads" an
access file to get recipe information. When a user first goes into it, they
should be displayed the 1st recipe in the database, but I am unsure how to
do this. I believe I can get that information if they click a button on the
form with the proper database read commands, but how do I tell VB to go
ahead and get that information for the 1st record BEFORE they click on
anything at all?

the Form_Load event happens before the form is shown. Perhaps
you can use that....

LFS


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #2
> I have not been able to figure out how to run code in a form, before any
buttons are pushed/clicked. What I have is a recipe manager that "reads" an access file to get recipe information. When a user first goes into it, they should be displayed the 1st recipe in the database, but I am unsure how to
do this. I believe I can get that information if they click a button on the form with the proper database read commands, but how do I tell VB to go
ahead and get that information for the 1st record BEFORE they click on
anything at all?


Are you saying you don't know about the Form_Load and/or Form_Activate
events, or are you having a different kind of problem?

Rick - MVP
Jul 17 '05 #3
Sorry for being trivial in this, but I am new to VB -- please bear with me
during my learning.
If there is a more basic VB newsgroup, I'd be happy to post these sort of
questions there, as
I only want to learn how to code properly.
I load my "View Recipes Form" from my "Main Menu Form" with a:

Private Sub cmdViewRecipe_Click()
frmViewRecipe.Show
Unload frmMainMenu
End Sub

Are you saying I should read the 1st item of the database inside this
command like:

Private Sub cmdViewRecipe_Click()
frmViewRecipe.Show
Data1.RecordSet.Movefirst
Unload frmMainMenu
End Sub

(the Data will appear then in the View Recipe form?)
And, if that is the case, Data1 being the name of my Data Control Object ...
I need to figure
out what that is as well -- what exactly a Data Control Object is as I am
not finding where to
actually "set" what that is.

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:vc********************@comcast.com...
I have not been able to figure out how to run code in a form, before any
buttons are pushed/clicked. What I have is a recipe manager that "reads"
an
access file to get recipe information. When a user first goes into it,

they
should be displayed the 1st recipe in the database, but I am unsure how

to do this. I believe I can get that information if they click a button on

the
form with the proper database read commands, but how do I tell VB to go
ahead and get that information for the 1st record BEFORE they click on
anything at all?


Are you saying you don't know about the Form_Load and/or Form_Activate
events, or are you having a different kind of problem?

Rick - MVP

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: BadOmen | last post by:
I am using Win XP and when I exit my program by clicking the X it locks like it is closed but if I check the Activity Handler( I don't know the right English word for it) it is still there under...
7
by: Christopher Brandsdal | last post by:
Hi! I have a problem running my code on 2000 server and iis5.0. The code runs perfectly on my localhost (xp iis5.1) but when i run it on 2000 server iis5.0 I get this error: ...
4
by: Si | last post by:
Hi Guys I am using this code to execute an Access VBA function from ASP: strDbName = strDataSource & "data\webjobs.mdb" Set objAccess = Server.CreateObject("Access.Application")...
4
by: Randy | last post by:
Hi, ok, I found a way to connect to a running instance of an (external) Internet Explorer and access - for example - the html source. That works fine! But now I have running application with...
7
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
3
by: Anil Kumar Sharma | last post by:
Hello, I am working on C# using vs.net 2003. I have faced two interesting problems. 1. Dynamically setting Default Button: I created a form and used it in various contexts. On basis of the...
5
by: jeremy | last post by:
I have an ASP.Net 2.0 application running on Windows Server 2003. The application displays properly in Internet Explorer, however, when I use a browser control embedded in a .net form, I get an...
9
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
1
by: BrianMiller | last post by:
I have searched for an answer but have failed to come up with anything that seems to work. I am trying to set up an Access 2003 database for home accounts. I want to create a running sum (a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.