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

How to Code This Logic

12
Hello to everybody.
I'm trying to come up with the VBA code that will do following:
my continiuos form has txt.NewSeat, txtOldSeat, chkMoving.
If NewSeat equals OldSeat then- Moving is False, else Moving is True

Where do I put If statement here:
Expand|Select|Wrap|Line Numbers
  1.     private sub SetMoving()
  2.  
  3.         dim rs as dao.recordset
  4.  
  5.         set rs=me.recordsetclone
  6.         do while rs.eof = false
  7.             rs.edit
  8.             rs!Moving = True
  9.             rs.update
  10.             rs.movenext
  11.         loop
  12.         rs.close
  13.         set rs=nothing
  14.     end sub
Thank you very much!
This forum has been very helpful!
Oct 4 '07 #1
3 976
VictorS
12
I fugured out. Can't believe it- it was so simple!


Expand|Select|Wrap|Line Numbers
  1. Private Sub Seat___AfterUpdate()
  2. If Me.SeatNum = Me.OldSeat Then
  3. Me.Moving = False
  4. Else
  5. Me.Moving = True
  6. End If
  7. End Sub
Oct 4 '07 #2
Scott Price
1,384 Expert 1GB
Glad you got it figured out, and thanks for posting back with what worked!

Regards,
Scott
Oct 4 '07 #3
NeoPa
32,556 Expert Mod 16PB
Victor,

Nicely done and thanks for posting back.
Remember to use the Tags in future though ([ CODE ] etc - Click on Hash (#)).
It could also be done as :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Seat___AfterUpdate()
  2.   Me.Moving = (Me.SeatNum <> Me.OldSeat)
  3. End Sub
Oct 4 '07 #4

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

Similar topics

8
by: jvyyuie | last post by:
// My email is jvyyuie@hotmail.com // I want to make some friends and discuss about programing. #include "stdafx.h" #include <malloc.h> #include <string.h> #define sec1...
2
by: Guadala Harry | last post by:
I have some logic that currently processes values retrieved by looping through a HashTable/ListDictionary structure (a hash table that contains ListDictionary objects as its values). Logically it's...
1
by: Chris Kettenbach | last post by:
Hi I am designing an ASP.net app. Just wanted some opinions on code behind options. My idea is to have a code behind file that the controls will reference and have ascx files for the controls. ...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
21
by: Brett | last post by:
Say I develop an application that has an SQL Server 2000 back end with ASP.NET front end. All the business logic is in the aspx pages. I want to sell this as a package that some one can install...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
24
by: Gaijinco | last post by:
I found one of that problems all of us have solve when they begin programming: given 3 numbers print the greater and the lesser one of the set. I was trying to remember the if-then-else...
10
by: Mythmon | last post by:
I am trying to make a program that will basically simulate a chess clock in python. To do this I have two threads running, one that updates the currently running clock, and one that watches for a...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
1
by: suneel271 | last post by:
code working in internet explorer but not in mozilla and iam getting erroe like window.event has no properties and here is the code <%@ page language="java" contentType="text/html;...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.