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 Wanet Telecoms Ltd 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

    ...variable does solve the problem. Thanks. So to sum up. The following code: int main() { int Phase = 3; double kva = 1000, x; x = 1000 * Phase/3.0; if( kva > x ) printf("greater than"); else printf("less than or equal"); return 1; } returns the...
  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

    ...( 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 1; } I am compiling this program under...
  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

    ...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 = rs(&quot;drawing # prefix&quot;) rs.MoveNext prefix2 =...
  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

    ...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 ADODB.Recordset 'syntax error here [COLOR=#ff0000] rst.Open = &quot;SELECT WSPECS.*...
  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

    ...With Set rst = New ADODB.Recordset rst.CursorType = adOpenDynamic rst.LockType = adLockOptimistic rst.Open &quot;SELECT * FROM name_of_your_table_here WHERE field_in_table_to_search = ME![name_of_unbound_textbox]&quot;, CurConn, , , adCmdText 'displays the...
  18. momon

    Quick Question. Problem with rst.open

    ....ConnectionString = &quot;data source= &quot; & CurDB.Name .Open End With Set rst = New ADODB.Recordset rst.CursorType = adOpenDynamic rst.LockType = adLockOptimistic 'something is wrong here rst.Open &quot;SELECT WSPECS.*, WSPECS.
  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