Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: momon
  • Order by date
  1. momon

    if statement in code is not working

    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...
  2. momon

    if statement in code is not working

    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...
  3. momon

    if statement in code is not working

    haha... i love when this kind of thing happens. thanks for running the code.
  4. momon

    if statement in code is not working

    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(&quot;greater than&quot;); else printf(&quot;less than&quot;); return...
  5. momon

    alternative to sleep(); needed

    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.
  6. momon

    NorthwindCS

    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...
  7. momon

    Better Coding

    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(&quot;select * from [core surplus]&quot;) prefix0 = rs(&quot;drawing # prefix&quot;) rs.MoveNext prefix1 =...
  8. momon

    SQL syntax

    yay tony... you fixed it...
  9. momon

    SQL syntax

    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(&quot;SELECT [DRAWING # PREFIX] FROM CORE WHERE [DRAWING NUMBER]=&quot; & Me!prefix2 ) Notice that I have switched the location of...
  10. momon

    SQL syntax

    I have the following Set rs = CurrentDb.OpenRecordset(&quot;SELECT [DRAWING NUMBER] FROM CORE WHERE [DRAWING # PREFIX]=&quot; & &quot;&quot; & Me!prefix2 & &quot;&quot;) It gives the error: --- Run-time error '3075' Syntax error (missing operator) in query expression '[DRAWING #...
  11. momon

    Delay in Updating Record

    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...
  12. momon

    Delay in Updating Record

    1) About 4 000 records with each record having about 150 fields 2) I am using JET 3) Yes, this is an networked application
  13. momon

    Delay in Updating Record

    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...
  14. momon

    Quick Question. Problem with rst.open

    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...
  15. momon

    Creating event procedures in option groups

    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 &quot;No&quot; Checkbox, let's call it Check0 Right click on the &quot;No&quot; checkbox and...
  16. momon

    Changing form propeties in an OnLoad Event?

    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!
  17. momon

    Look up

    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...
  18. momon

    Quick Question. Problem with rst.open

    When I try to open the form, it gives me the error: &quot;The connection cannot be used to perform this operation. It is either closed or invalid in this context.&quot; Here is the code for the On_Load event for the form: Private Sub Form_Load() On Error GoTo Form_Load_Err Dim CurConn...
  19. momon

    MESSAGE CRACKERS

    Doesn't seem to work... Any more ideas? Thanks in advance.
  20. momon

    MESSAGE CRACKERS

    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...

Part and Inventory Search

Back
Top