473,385 Members | 1,593 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,385 software developers and data experts.

My Trial Switchboard problem

I have a main table with a unique id, name tblMain this is where I get my unqID, I also made another table named tblClone using the SELECT Update. I have two forms Form1,Form2, 1 command button and textbox named txtTotal. My Form1 is used as a switchboard for my Form2.

in my Form2 I put my textbox and set Me.txtTotal= DCount("[unqID]","[tblClone]") and

in my Command1 I put my command1 button and set Me.Visible=False to close my switchboard and
DoCmd.OpenForm "Form2", acNormal

my problem is, every time I click my command1 button to show Form2.My txtTotal shows 0 value. I don’t understand it because vba doesn’t show any error during runtime and when I switched to design view and manually open my Form2. this is the only time my Form2 shows the correct value counted.

How can I make my txtTotal to show my total value when I clicked my commnd1 button from Form1? Is my switchboard the problem? Please help
May 21 '08 #1
6 1372
patjones
931 Expert 512MB
I have a main table with a unique id, name tblMain this is where I get my unqID, I also made another table named tblClone using the SELECT Update. I have two forms Form1,Form2, 1 command button and textbox named txtTotal. My Form1 is used as a switchboard for my Form2.

in my Form2 I put my textbox and set Me.txtTotal= DCount("[unqID]","[tblClone]") and

in my Command1 I put my command1 button and set Me.Visible=False to close my switchboard and
DoCmd.OpenForm "Form2", acNormal

my problem is, every time I click my command1 button to show Form2.My txtTotal shows 0 value. I don’t understand it because vba doesn’t show any error during runtime and when I switched to design view and manually open my Form2. this is the only time my Form2 shows the correct value counted.

How can I make my txtTotal to show my total value when I clicked my commnd1 button from Form1? Is my switchboard the problem? Please help
Hi:

What event for Form2 did you put the text box assignment in? If you can post the code that you're using that would be great.

Pat
May 21 '08 #2
I hope I get what you ask. this is where I assigned my txtClone.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Me.txtToatl=DCount("[UnqID]","[tblClone]")
  3.  
  4. End Sub
thanks for replying!
May 22 '08 #3
NeoPa
32,556 Expert Mod 16PB
Please remember to use the [ CODE ] tags in future. Congratulations on reaching full member status btw :), but we do expect our members to remember this in their posts ;)

Anyway, first things first. Are you aware that the code you posted misspells txtTotal? This may be as it is set up in your database of course. Either way it's a bad sign. Attention to detail is fundamental to working with databases. This could actually be why it's failing.

Do you enforce variable declaration in your code?
May 22 '08 #4
patjones
931 Expert 512MB
Anyway, first things first. Are you aware that the code you posted misspells txtTotal? This may be as it is set up in your database of course. Either way it's a bad sign. Attention to detail is fundamental to working with databases. This could actually be why it's failing.
But cephal0n says that it shows the correct value when he opens the form manually. I wondered if it had something to do with using Form Load instead of Form Open, so I made a little test db and used Form Load. I found that it doesn't matter whether I open the form manually, or open it by clicking on the command button in the first form.

cephal0n, you are running the DCount off "tblClone", which you say comes from a SELECT Update. Does this mean that it's a temporary table that comes into existence only when Form 2 opens?

Pat
May 22 '08 #5
Hi everyone!

I apologize for the delay I was still trying out INSERT INTO sql instead of SELECT UPDATE and still getting the same results. Before I go on I would like to thank you guys for replying to my question. I was hoping this will be a simple question with simple answer, but I guess not.

About the question
Do you enforce variable declaration in your code?

I really don’t want to make it complicated I just want to show the results first before going to my next procedure.

And about the question
cephal0n, you are running the DCount off "tblClone", which you say comes from a SELECT Update. Does this mean that it's a temporary table that comes into existence only when Form 2 opens?

yes, my table tblClone only comes into existence if my Form2 is called. My main source table tblMain can change data anytime and can contain 500 or more Items, so every time changes are made, so will my tblClone's data changes as well and this is where I usually do my computations and more.

I hope I answered your questions and Thanks in advanced!
May 27 '08 #6
NeoPa
32,556 Expert Mod 16PB
...
About the question
Do you enforce variable declaration in your code?

I really don’t want to make it complicated I just want to show the results first before going to my next procedure.
...
I read this a number of times without understanding what you're trying to say.

Do you mean worrying about such trivial things as Variable Declaration would complicate things?

I want to assume not, as that would tough to reply to. I will restrict myself to saying that would be so wrong.
May 27 '08 #7

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

Similar topics

13
by: Mark | last post by:
I am looking for a switchboard creator alternative for my MDB. Can anyone help me? Thanks for your help, Mark
2
by: Dannic | last post by:
Here is the application. Its a simple application really. I have a db created in Access 2000 which opens to a switchboard created by the switchboard manager. Now the problem. This only works...
2
by: Dejan M. | last post by:
Can you help me? I have 9 forms in the base. 2 forms are opening as single and 7 as datasheet. Thats OK, but when I used Switchboard manager, with him all of my forms are opened as single. How can...
9
by: Baz'noid | last post by:
Hi all, My computer has suddenly decided that it doesn't like the switchboard - it's quite happy to open up on other machines, meaning the database itself isn't at fault, it must be something...
2
by: Terry | last post by:
I have created a switchboard, created using Access 2000. If I put the mouse anywhere on the form, outside of the checkboxes and scroll the wheel backwards, I get the following error. Run-Time...
2
by: Neil Greenough | last post by:
I am trying to create a Switchboard using the Switchboard Manager in MS Access 2000. I have managed to get the table created for the switchboard, however it hasn't actually created the form. ...
2
by: tdmailbox | last post by:
I am in the process of finishing up moderate sized access database application. I am in the process now of building a switchboard to house all the forms and reports. I decided the in built in...
8
by: Ray Greene | last post by:
I was working in Access and everything disappeared from the screen. When I closed and reopened the file there was no switchboard. I can open tables and forms etc if I select a category from the...
6
by: keri | last post by:
Please help, i'm baffled. I have opened my db and recieved an error on this code which starts the switchboard. As i didn't write this code i'm baffled, and I don't think I have made any changes...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.