473,396 Members | 2,036 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,396 software developers and data experts.

How can I get Access to remember a digit or a character?

222 100+
Hello everybody;

How may I write a function on MS access to carry a digit and use it in my forms.?


For example a continuous form contains sceneID as primary key and scene descreption (refer to scene table)

When user double click on the sceneID I want a function to memories this ID for later use (as buffer) even the form will be closed.


Please advise me.

WASSIM S DACCACHE
May 2 '08 #1
22 1624
Delerna
1,134 Expert 1GB
You could use a code module and put a global variable in there.
When you double click you set the variable equal to what you want memorized.
Now you just reference the global variable when you want to use the value that was memorized.
May 3 '08 #2
wassimdaccache
222 100+
You could use a code module and put a global variable in there.
When you double click you set the variable equal to what you want memorized.
Now you just reference the global variable when you want to use the value that was memorized.
Could you please provide me the syntax and the method to write a global function.

Any link about this subject might help me.


Appreciate your help.

Take care;


WASSIM S DACCACHE
May 3 '08 #3
Delerna
1,134 Expert 1GB
1) open access
2) goto modules tab and click new
3) In code widow on a new line type
Expand|Select|Wrap|Line Numbers
  1. Public NameOfYourVariable as int
  2.  
4) save the module and call it "PublicStuff" or something like that

Ok thats your global variable created.
Now in the code page for the form you want the double click to memorize.

Expand|Select|Wrap|Line Numbers
  1. Private sub txtSceneID_DblClick(Cancel As Integer)
  2.    NameOfYourVariable=txtSceneID
  3. End sub
  4.  
txtSceneID is the name of the control on the form that you want to add the double click functionality to

Ok now the SceneID has been saved into NameOfYourVariable and you can get its value from anywhere. That will remain true until the database is closed.


so for example, in the code page for another form you could do this.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.    txtNameOfATextboxControlOnTheForm = NameOfYourVariable
  3. End Sub
  4.  

Does that help?
May 3 '08 #4
wassimdaccache
222 100+
1) open access
2) goto modules tab and click new
3) In code widow on a new line type
Expand|Select|Wrap|Line Numbers
  1. Public NameOfYourVariable as int
  2.  
4) save the module and call it "PublicStuff" or something like that

Ok thats your global variable created.
Now in the code page for the form you want the double click to memorize.

Expand|Select|Wrap|Line Numbers
  1. Private sub txtSceneID_DblClick(Cancel As Integer)
  2.    NameOfYourVariable=txtSceneID
  3. End sub
  4.  
txtSceneID is the name of the control on the form that you want to add the double click functionality to

Ok now the SceneID has been saved into NameOfYourVariable and you can get its value from anywhere. That will remain true until the database is closed.


so for example, in the code page for another form you could do this.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.    txtNameOfATextboxControlOnTheForm = NameOfYourVariable
  3. End Sub
  4.  

Does that help?
Yeah it is working well. Appreciate your help again






WASSIM S DACCACHE
May 3 '08 #5
ADezii
8,834 Expert 8TB
Could you please provide me the syntax and the method to write a global function.

Any link about this subject might help me.


Appreciate your help.

Take care;


WASSIM S DACCACHE
Be advised that assigning a value to a Global Variable will not retain that value once the Form is closed. You seem to indicate that this was your intention. In this case I would normally write the value to an Internal, Hidden Table or store it in the System Registry (my favorite).
May 3 '08 #6
wassimdaccache
222 100+
Dear Sir,


You are right I oblige user to don;t close the form meanwhile I did what I was looking for.

Now it is for my curiosity ;). If I want to close the form that is carrying the value and I don't want to save it in a form because I am sharing my database on my network and I assign for every user a file that contain forms (Link database) .

How may I do it using the registry? Do I have a limited size in the registry ?

Could you send me any link about this subject it might be useful...

Thank you in advanced

Take care

WASSIM S DACCACHE
May 3 '08 #7
ADezii
8,834 Expert 8TB
Dear Sir,


You are right I oblige user to don;t close the form meanwhile I did what I was looking for.

Now it is for my curiosity ;). If I want to close the form that is carrying the value and I don't want to save it in a form because I am sharing my database on my network and I assign for every user a file that contain forms (Link database) .

How may I do it using the registry? Do I have a limited size in the registry ?

Could you send me any link about this subject it might be useful...

Thank you in advanced

Take care

WASSIM S DACCACHE
Youo can reference the SaveSetting Statement and GetSetting() Functions in the Access Help Files for an explanation and demo.
May 4 '08 #8
Delerna
1,134 Expert 1GB
Sorry, but I tried it out when i was developing the solution and if you put the global variable into a code module then you most certainly can retain and access its contents without the need of any form being left open.

If you put the global variable into the forms code page then yes you must have that form open. But if you put it in a code module then it remains active until you close the database.
May 4 '08 #9
ADezii
8,834 Expert 8TB
Sorry, but I tried it out when i was developing the solution and if you put the global variable into a code module then you most certainly can retain and access its contents without the need of any form being left open.

If you put the global variable into the forms code page then yes you must have that form open. But if you put it in a code module then it remains active until you close the database.
Thanks for the clarification Delerna. You are, of course, correct and I apologize for the confusion.
May 4 '08 #10
NeoPa
32,556 Expert Mod 16PB
...
You are right I oblige user to don;t close the form meanwhile I did what I was looking for.
Wassim, You do understand that this is no longer required now don't you? The value will persist for as long as the project code is active (Unless the project is stopped due to a design change in the database or the database is closed).
May 5 '08 #11
wassimdaccache
222 100+
Wassim, You do understand that this is no longer required now don't you? The value will persist for as long as the project code is active (Unless the project is stopped due to a design change in the database or the database is closed).
Yes sir I do understand but actually still have a problem my file is shared into 12 computers and each one contains its specific form what I need is to use the file shared (contains the table) function. In another meaning I need the function to carry me the digit or string for all forms linked to the file shared.

How May I call a function from another database ?


please give me your opinion.

Best regards,


WASSIM S DACCACHE
May 6 '08 #12
NeoPa
32,556 Expert Mod 16PB
Wassim, I'm afraid I have very little idea what you're trying to say :S

I would think that the answer previously given is what you need, but I'm not sure because I don't know what you're asking now.
May 6 '08 #13
wassimdaccache
222 100+
Wassim, I'm afraid I have very little idea what you're trying to say :S

I would think that the answer previously given is what you need, but I'm not sure because I don't know what you're asking now.
Dear neo,

I'll try to be more clear in my question.

what Mr. Delerna told me about the public function it works even when I close the file.

Now it is another subject under the same title.

The idea is to split my file into tables(file1) and forms(file2)
file2 is linked table on file1

the problem that I am facing is:
when I call the function in file 2 it is not working. the function is just working locally.

How may use the function from the file1 ?


I would like to advise me.

Best regards
May 6 '08 #14
NeoPa
32,556 Expert Mod 16PB
I think I understand better now Wassim.

I'm not sure exactly how you've organised your two database, but when organised in the usual FrontEnd/BackEnd (FE/BE) way, there should be no such problems. Check out Front-End / Back-End (FE/BE) for more on this subject.

PS. I should point out that new questions should really be put in separate threads. There are various reasons for this, one of which is that it will tend to mean that your new question is not seen as such, and may get overlooked by many of our experts (You appreciate that they're not looking for answered questions). Another is that responses will be less clear as it is possible for other posters to add posts related to the original question. This can only lead to confusion.
Please post your questions in their own threads in future (See How to Ask a Question).
May 6 '08 #15
Delerna
1,134 Expert 1GB
Hi wassim.
In the scenario you have presented, I think the better option would be as NeoPa suggests. One backend db with all the tables and data and as many copies of a front end that are linked to the tables in the backend and have all the reports, queries forms etc.
I think that is what you are describing anyway.

Anyway, instead of having a public variable in the front ends, you could have a table in the backend and save the ID into that table instead. That way all frontends would have access to the same table and therefore the same ID.
I have given an idea here, you will need to develop it to suit your needs
May 6 '08 #16
NeoPa
32,556 Expert Mod 16PB
It seems I didn't understand the question as clearly as I thought I had :/
  1. If you want a value to persist within a particular user's session, then a global variable is a good way to do it. This would be in the FE database.
  2. If you want a value to persist, and be shared by various operators, then storing it in a table in the BE database would be a good way to handle this.
  3. If you want a value to persist and be available to the same operator, but from any of the FE databases, then storing (tagged) it in a table in the BE database would be a good way to handle this. This would involve storing an operator identifier with the data in the table. Clearly you'd need a method of identifying operators for this approach.
May 7 '08 #17
wassimdaccache
222 100+
Hi Sirs,

I would like to appreciate your feedbacks about my post.

I apologize for not being clear from the beginning due to my problem process (locally and shared).

I think the best way is to save my record in a temporary table and use this value in as you advise.


Thank you again.

Best regards;
May 9 '08 #18
NeoPa
32,556 Expert Mod 16PB
Wassim, I see no benefit in saving the value in a temporary table.

As a matter of interest, which of scenarios A, B or C most closely fits yours (See post #17)?
May 9 '08 #19
wassimdaccache
222 100+
Wassim, I see no benefit in saving the value in an temporary table.

As a matter of interest, which of scenarios A, B or C most closely fits yours?
Dear Neo;

I think choice B is most closely to my IDEA.

Could you please explain to me what is really different between B and C ? and what do you prefer to use.

NB: I want to all users use the same variable. For example the first user who execute his database (here I mean FE DB) all user must use the same variable saved. For this reason I see to save the variable in a temporary table in the (BE DB)and all other use this variable.

Please advise me to proceed.


Thank you in advance


Best regards;

WASSIM S DACCACHE
May 9 '08 #20
NeoPa
32,556 Expert Mod 16PB
In that case Wassim, you are thinking along the right lines.

The only point I would question is the temporary nature of the table. Certainly a table in the BE DB would be a good place to maintain this information.

Good luck with your project :)
May 9 '08 #21
wassimdaccache
222 100+
Dear Neo;


Thank you for the direction that you drew for me. ;)



Best regards;
May 9 '08 #22
NeoPa
32,556 Expert Mod 16PB
No problems :)

Let us know how you get on.
May 9 '08 #23

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

Similar topics

11
by: Randy Weber | last post by:
I am getting unexpected results with a Like Query using ASP and an Access database. This query - SELECT PN, Qty From Inventory Where PN Like 'SSW-10%'; returns what I expect: PN ...
4
by: looking4clues | last post by:
Hi, I would like to know if Access 2.0 can be made to operate on Windows XP. I have used Access 2.0 and my database on a Windows 98 machine for some while, and decided to upgrade to a new...
20
by: Drebin | last post by:
It's a long story really, but the bottom line is we need to encrypt or obfuscate a clear-text 9-digit SSN/taxpayer ID into something less than 21 characters. It doesn't need to be super-secure,...
3
by: Ivan | last post by:
Hi, how to filter out non-digit chars when user writes text to System.Windows.Forms.TextBox? Thanks, Iavmn
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
32
by: vonclausowitz | last post by:
Hi All, I have database with names on which I want to use the soundex option. So I have created two seperate fields for the Lastname and Firstname in which I save the Soundex version of a new...
10
by: D | last post by:
Hello everyone - I'm trying to compile an application to generate all possible 3 digit combinations using 0-9 and a-z, I've looked everywhere for a solution and I found Combinations! v 2.0 for...
7
by: Jay | last post by:
I want to check if a character is a decimal digit (0-9). I've found Char.IsNumber() and Char.IsDigit() but couldn't work out from Help how they differ. Also, do I need to worry about how digits...
1
MMcCarthy
by: MMcCarthy | last post by:
Access has a number of built-in functions which can be generally used in queries or VBA code. Some of the more common ones are: Note: anything in square brackets is optional Date Functions ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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,...
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...

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.