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

Access 2000 - Carry a number through to another form

116 100+
All

I am using Access 2000

I have created a list of records. When I double click the job number field it opens a new form.

The code i use is this.

Expand|Select|Wrap|Line Numbers
  1. Dim stDocName As String
  2. Dim stLinkCriteria As String
  3.  
  4. stDocName = "frm_adjust_magazine_overs"
  5. DoCmd.OpenForm stDocName, , , stLinkCriteria
I then retype that job number into the job number field on that new form and enter some figures.

Ideally what I would like to do is to double click on the job number and that same number copy into the newly opened form so I can then add my figures.

Thanks
Jacc14
Aug 13 '08 #1
9 1845
Krandor
50
Very simple.

Create a new module.

enter the following:
Option Compare Database
Option Explicit

Public gn_YourNumber as double 'this is a global variable

Now go to the first form. Now make gn_YourNumber equal to the number you are trying to pass.

Now on the second form, you load the text box with your global variable in form load sub.

That's all there is.


Ramon
Aug 13 '08 #2
jacc14
116 100+
Hi Ramon

Thanks for the advice, and so prompt. I have created the module but unfortunately am not an expert on this so not sure how to do the next bits.

"Now go to the first form. Now make gn_YourNumber equal to the number you are trying to pass.

Now on the second form, you load the text box with your global variable in form load sub."


On the second form I have put the following.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Me.OrderNo.Value = gn_Number 
End Sub

Hope you can help

Thanks
Jacc14
Aug 14 '08 #3
hjozinovic
167 100+
On your First form go to OnDouble_click event of the JobNumber control.
Put in a code like:
Expand|Select|Wrap|Line Numbers
  1. gn_YourNumber = Me!JobNumber
..and keep in place the rest of your original code that is allready there :-)
Aug 14 '08 #4
mshmyob
904 Expert 512MB
I personally would just use the OpenArgs parameter when you do your Docmd.openform.

Then in the Open event of the second form that you open you pick up the passed argument.

No need for modules.

cheers,
Aug 14 '08 #5
mshmyob
904 Expert 512MB
As an ammendment if it is a true number field use the CStr and Val function.
Aug 14 '08 #6
NeoPa
32,556 Expert Mod 16PB
Are you clear on that now Jacc?

If not I'm sure we can answer any questions you still have.
Aug 15 '08 #7
jacc14
116 100+
thanks for this.

Just got back from a 2 week break so will have another go.

Cheers
jacc14
Aug 29 '08 #8
jacc14
116 100+
Hi

Thanks all for your help. RESULT :)

Best regards

Jacc14
Sep 1 '08 #9
NeoPa
32,556 Expert Mod 16PB
Good to hear that helped :)
Sep 1 '08 #10

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

Similar topics

0
by: M. Farrenkopf | last post by:
I am in the process of converting a Jet database to ADP using SQL Server 2000. Most of this conversation has been smooth, but now I'm running across a problem that has me stumped. Access 2000 SP3...
8
by: William Bradley | last post by:
First of all I have been working with Access 97 and this morning the owner of the business phoned me to inform me that he had updated to Access 2000 and parts of my forms would not work anymore. ...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
3
by: Iain Miller | last post by:
Can anybody help me with some Access 2000 code? I don't do a lot of coding in Access & so every time I come back to do something I pretty much have to relearn the syntax from scratch so this is...
14
by: Crimsonwingz | last post by:
Need to calculate a sum based on a number of factors over a period of years. I can use formula ^x for some of it, but need totals to carry over in the sum and have only been able to do this thus...
47
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
5
by: Easystart | last post by:
Hi, Sorry for my English. English is not my native tougue. I am working in MS Access 2000 with a SQLServer 2000 Backend database. MS Access 2000 is my GUI front end that has SQLServer linked...
2
by: collegekid | last post by:
Hi everyone, basically my problem is this: I am using an Access 2000 format. And--I have four subforms in my main form. (Purpose of this is to track projects.) So in my main form I enter the...
9
by: Ron | last post by:
Hi All, I've recently installed a program written in Access 2000 on a laptop. The laptop had an existing Office 2000 Pro which of course included Access. But the program acts oddly (more oddly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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.