The result is "greater than or equal". However, it is in fact equal since replacing the condition ( kva >= x ) with ( kva > x ) results in "less than" being printed.
So the use of an intermediate variable does solve the problem. Thanks.
So to sum up.
The following code...
hi.
thanks for reading the post victorv.
The compiler does know about fractions and type conversions in expressions.
For example,
int / int results in an int. e.g. 1/3 = 0
double / int results in a double e.g. 1.0/3 = 0.333...
int / double also results in double e.g. 1/3.0 = 0.333...
but to...
Hi everyone.
This is a very easy question ( or so it seems ).
Here is a short piece of code:
#include <stdio.h>
int main() {
int Phase = 3;
double kva = 1000;
if( kva > (1000 * (Phase / 3.0)) )
printf("greater than");
else
printf("less than");
return...
hey try usleep(x) where x is in microseconds.
for example usleep(500000) will sleep for 0.5 seconds...
i don't know if this will work.
it's just an idea.
Hello,
I am trying to switch from a database running on the JET engine to one that uses MSDE. However, I am having some difficulties getting the sample database NORTHWINDCS to work.
I have two computers both with WIN XP PRO installed. Let's say my computer is named A and the remote computer is...
Hello,
I have the following code and I was wondering if it could be reduced
Private Sub Form_Load()
On Error GoTo form_load_err
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("select * from [core surplus]")
prefix0 = rs("drawing # prefix")
rs.MoveNext
prefix1 =...
Thanks John
I also thought that # character was interpreted as some type of delimiter.
But it's funny that this code works.
Set rs = CurrentDb.OpenRecordset("SELECT [DRAWING # PREFIX] FROM CORE WHERE [DRAWING NUMBER]=" & Me!prefix2 )
Notice that I have switched the location of...
I have the following
Set rs = CurrentDb.OpenRecordset("SELECT [DRAWING NUMBER] FROM CORE WHERE [DRAWING # PREFIX]=" & "" & Me!prefix2 & "")
It gives the error:
---
Run-time error '3075'
Syntax error (missing operator) in query expression '[DRAWING #...
The funny thing is that when I write the equivalent code in DAO I don't experience this problem of delayed table updates.
Here is the code
Private Sub Command55_Click()
On Error GoTo command55_click_err
Dim dbs As Database, rst As DAO.Recordset
Dim quote As String
Dim number As Integer
Dim...
Ok, the following code checks to see if a record exists in the ORDER table, and if it doesn't it adds it to the table. It uses an ADO implementation. Now, the problem is, it takes a while before the ORDER table is updated with the new entry. I was thinking that the table would be updated...
hmmm.. tried it but now there is a compile error.
The SQL is pasted right from Access, so I am not sure what is wrong.
Code looks like this now.
Private Sub Form_Load()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = CurrentProject.Connection
Set rst = New...
ok great.
Here is how you do it.
Create a textbox, name it Text2.
Right click on the Text2 textbox. Select PROPERTIES
Click on the FORMAT tab.
Set the VISIBLE property of NO. (3 rows down)
Create the "No" Checkbox, let's call it Check0
Right click on the "No" checkbox and...
I'm no expert. But if you above code doesn't work you could try this:
Private Sub Form_Open(Cancel As Integer)
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = True
Me.DataEntry = True
End Sub
Hope this helps!
ok.
You want to search the underlying records for a given criteria that you specify.
Ok, here is a way using code. It is kind of general because I don't really know what your database is supposed to do
Private Sub Command6_Click()
On Error GoTo Command_Click_Err
Dim CurConn As New...
When I try to open the form, it gives me the error:
"The connection cannot be used to perform this operation. It is either closed or invalid in this context."
Here is the code for the On_Load event for the form:
Private Sub Form_Load()
On Error GoTo Form_Load_Err
Dim CurConn...
I have the following code that works perfectly when compiled in 16-bit. When it is compiled in 32-bit, there is no response when a particular menu option is selected. The code looks something like this:
//this part doesn't seem get executed, probably because the
//program is confused by WPARAM...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.