473,466 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Create 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_tab.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 1563
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_tab.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.Value = 2

or

Forms.Form1.TabCtl0.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_tab.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
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...
8
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. ...
9
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...
2
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...
0
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,...
4
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...
0
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...
3
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
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">...
0
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.