473,546 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with a startup script

157 New Member
Hello!

I am trying to make a startup script which selects a predefined TAB page from a form at startup.

This is how i want it to be:

I have a table which contains user-data. In this i have a collum called "Startup tab" where the user can predefine which startup page he wants from the tab control. Short explained i want the code to do this job: Me.preffered_ta b.setfocus on startup, and that the preffered tab should be looked up from a table

For this i use
Expand|Select|Wrap|Line Numbers
  1. DLookup("[Startup tab]", "main tbl brukere", "username='" & ntlogin & "'")
Then, on the form_load event i tried to place this code
Expand|Select|Wrap|Line Numbers
  1. Dim ntlogin As String
  2. Dim su As ???
  3.  
  4. Init_Globals
  5.  
  6. ntlogin = Environ("Username")
  7.  
  8. su = DLookup("[Startup fane]", "main tbl brukere", "Brukernavn='" & ntlogin & "'")
  9.  
  10. [Form_MAIN Hovedmeny].su.SetFocus
But this gives me the errorcode of "Method or datamember not found".
I am pretty sure i need to Dim SU as something (it is dimmed as text in the table), but i dont know what.

Any suggestions?
Aug 18 '07 #1
3 1568
JConsulting
603 Recognized Expert Contributor
Hello!

I am trying to make a startup script which selects a predefined TAB page from a form at startup.

This is how i want it to be:

I have a table which contains user-data. In this i have a collum called "Startup tab" where the user can predefine which startup page he wants from the tab control. Short explained i want the code to do this job: Me.preffered_ta b.setfocus on startup, and that the preffered tab should be looked up from a table

For this i use
Expand|Select|Wrap|Line Numbers
  1. DLookup("[Startup tab]", "main tbl brukere", "username='" & ntlogin & "'")
o
Then, on the form_load event i tried to place this code
Expand|Select|Wrap|Line Numbers
  1. Dim ntlogin As String
  2. Dim su As ???
  3.  
  4. Init_Globals
  5.  
  6. ntlogin = Environ("Username")
  7.  
  8. su = DLookup("[Startup fane]", "main tbl brukere", "Brukernavn='" & ntlogin & "'")
  9.  
  10. [Form_MAIN Hovedmeny].su.SetFocus
But this gives me the errorcode of "Method or datamember not found".
I am pretty sure i need to Dim SU as something (it is dimmed as text in the table), but i dont know what.

Any suggestions?

You have to set the value of the tab control itself.

Me.TabCtl0.Valu e = 2

or

Forms.Form1.Tab Ctl0.Value = 2

Where 2 is th Tab Index set up in the tab's control properties.

J
Aug 18 '07 #2
MrDeej
157 New Member
Thank you!

I made a table (Main Tab name) which contains the tab.name and tab.nr and i ended up with this code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3. Init_Globals
  4. ntlogin = Environ("Username")
  5.  
  6. Value_preffered_tab = DLookup("[preffered tab]", "Main tbl  users", "username='" & ntlogin & "'")
  7. tab_nr = DLookup("tabnr", "Main tab name", "Tab name ='" & Value_preffered_tab & "'")
  8.  
  9. Me.tabctl.Value = tab_nr
  10.  
  11. End Sub
  12.  
Aug 19 '07 #3
ADezii
8,834 Recognized Expert Expert
Hello!

I am trying to make a startup script which selects a predefined TAB page from a form at startup.

This is how i want it to be:

I have a table which contains user-data. In this i have a collum called "Startup tab" where the user can predefine which startup page he wants from the tab control. Short explained i want the code to do this job: Me.preffered_ta b.setfocus on startup, and that the preffered tab should be looked up from a table

For this i use
Expand|Select|Wrap|Line Numbers
  1. DLookup("[Startup tab]", "main tbl brukere", "username='" & ntlogin & "'")
Then, on the form_load event i tried to place this code
Expand|Select|Wrap|Line Numbers
  1. Dim ntlogin As String
  2. Dim su As ???
  3.  
  4. Init_Globals
  5.  
  6. ntlogin = Environ("Username")
  7.  
  8. su = DLookup("[Startup fane]", "main tbl brukere", "Brukernavn='" & ntlogin & "'")
  9.  
  10. [Form_MAIN Hovedmeny].su.SetFocus
But this gives me the errorcode of "Method or datamember not found".
I am pretty sure i need to Dim SU as something (it is dimmed as text in the table), but i dont know what.

Any suggestions?
  1. Typically, su would be Declared as a Variant.
    Expand|Select|Wrap|Line Numbers
    1. Dim su As Variant
  2. When you get a chance, take a look at this Link.
    Accessing Tabs on a Tab Control
Aug 19 '07 #4

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

Similar topics

0
2251
by: Duane Winner | last post by:
Hello all - I'm having a small problem with the mysql startup script that ships with MySQL-3.23.56-1. I'm running on RedHat Linux. It works fine, but I have a backup server that runs a script that passes these commands remotely through ssh: (1) ssh dbsys-dc "sudo /etc/init.d/mysql stop" (2) ssh dbsys-dc "sudo tar
8
1573
by: John | last post by:
Hi, I'm using mysql-server-3.23.58-4 on a Linux (Fedora 1) machine. After reading the security section of the manual from http://dev.mysql.com, I added passwords for the 'root' accounts. However, now the startup script (/etc/rc.d/init.d/mysqld) fails. I tried adding:
9
4903
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What is meant by "Client Start Script"? Thanks, Harry
2
1219
by: bill yeager | last post by:
I'm registering a startup script in my "page load" event. Everything works fine when I run it locally, but when it's deployed to the webserver, it doesn't execute the javascript which is inside a ".js" file (on the root directory of the website). Here is the HTML where I have the javascript function to execute: <code> <TD style="HEIGHT:...
0
1211
by: Sim Zacks | last post by:
I reconfigured the redhat startup script for postgresql to work with version 8 and that is working fine. I thought I could put autovacuum in the startup script and that didn't cause any problems, but it didn't turn on and I had to start it manually. Does anyone know why it didn't catch? I was watching the bootup and it seemed that the...
4
2414
by: Larry | last post by:
I have a Perl script using DBD::DB2, that runs during system startup on a Solaris system. The script is working fine during startup on many machines, except on one machine it fails complaining about a missing ".so" file, with Perl flagging the "use DBD::DB2" line. (I don't have the exact message since I'm heard about it from a remote...
0
1188
by: Dhanashree | last post by:
I have a RangeValidator which uses AJAX to call server-side validation function from the client. The code works fine, but I have one problem. following is my range validator class: public class RangeValidator: BaseValidator,ICallbackEventHandler { public event ServerValidateEventHandler ServerValidate; String _controlToValidateValue;
3
11274
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
5
2599
by: mukeshrasm | last post by:
hello friends I am new to javascript and I have a problem. I am giving the code <!-- Paste this code into the CSS section of your HTML document --> <html> <head> <style type="text/css"> .menu { position:relative; background-color:gold;
0
7504
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7461
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7792
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5360
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5080
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.