473,738 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wie kann ich aus einem Formular aus Daten selektieren und in ein Textfeld schreiben?

Hallo liebe Gemeinde,

ich möchte aus einem Formular aus, eine bereits vorhandene
Laufendenummer aus einer Tabelle.spalte auslese und dazu noch eine 1
addiere und dann das Ergebnis in ein Textfeld dieses Formulars
schreiben! Danach werden weitere Daten von dem User eingegeben und
dann werden alle diese Daten (die neue Laufendenummer auch) in der
gleichen Tabelle als neuer Datensatz gespeichert.

Ich denke an:
SELECT Max([laufendenummer])+1 AS nummer FROM tabelle;

Wie kann ich das Ergebnis dieses Statments in einem Formular und
Textfeld umleiten?

Noch weitere Vorschläge?
PS: Es handelt sich dabei nicht um eine Primärschlüssel !
Nov 13 '05 #1
2 3807
amir wrote:
Hallo liebe Gemeinde,

ich möchte aus einem Formular aus, eine bereits vorhandene
Laufendenummer aus einer Tabelle.spalte auslese und dazu noch eine 1
addiere und dann das Ergebnis in ein Textfeld dieses Formulars
schreiben! Danach werden weitere Daten von dem User eingegeben und
dann werden alle diese Daten (die neue Laufendenummer auch) in der
gleichen Tabelle als neuer Datensatz gespeichert.

Ich denke an:
SELECT Max([laufendenummer])+1 AS nummer FROM tabelle;

Wie kann ich das Ergebnis dieses Statments in einem Formular und
Textfeld umleiten?

Noch weitere Vorschläge?
PS: Es handelt sich dabei nicht um eine Primärschlüssel !


Simplest way is in the form's beforeupdate event:
(Einfachste Weise ist im Fall beforeupdate der Form)

(air code)
Sub Form_BeforeUpda te(Cancel As Integer)
If isnull(me!laufe ndenummer) then
Me!laufendenumm er = Nz(DMax("laufen denummer","tabl e"),0) + 1
End If
End Sub

(dank Lycos Übersetzer)

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 13 '05 #2
am****@gmx.de (amir) wrote in message news:<c4******* *************** ****@posting.go ogle.com>...
Hallo liebe Gemeinde,

ich möchte aus einem Formular aus, eine bereits vorhandene
Laufendenummer aus einer Tabelle.spalte auslese und dazu noch eine 1
addiere und dann das Ergebnis in ein Textfeld dieses Formulars
schreiben! Danach werden weitere Daten von dem User eingegeben und
dann werden alle diese Daten (die neue Laufendenummer auch) in der
gleichen Tabelle als neuer Datensatz gespeichert.

Ich denke an:
SELECT Max([laufendenummer])+1 AS nummer FROM tabelle;

Wie kann ich das Ergebnis dieses Statments in einem Formular und
Textfeld umleiten?

Noch weitere Vorschläge?
PS: Es handelt sich dabei nicht um eine Primärschlüssel !


From <John Knapp> (email):

Hi dear community:
from a form I want to pick an already existing running number from a
table.column and add to this 1, and then write the result into a text
field of this form. After this more data is entered by the user and
then all these data (the new running number, too) will be saved as
new data set in the same table. I thought of SELECT Max (running
number) + 1 AS number FROM table. How can I route the result of this
statement in a form and a text field. Any more suggestions? These
are no primary keys!

Manuela (the translator)

I believe I guessed what the basic question was correctly the last
time:

txtRunning.Valu e = DMax("[laufendenummer]","[tabelle]","[laufendenummer]
IS NOT NULL")+1

in VBA code when you load the Form. Then you need to put it in a
location that runs after you do the Save. Isn't that what you are
trying to do? Is your Form bound to this Field? Perhaps someone else
can see why you're having problems.

James A. Fortune
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3695
by: Marcel | last post by:
Es soll aus einem Access 2002 AddIn (VBA) heraus eine Excel-Datei geöffnet und möglichst direkt gedruckt werden. Der Dateiname der Excel-Datei ist bekannt. Zuvor oder dabei, sollen VBA-Daten in bestimmte Zellen der Datei geschrieben werden! Wie kann ich das umsetzen??? Vorab Danke für Eure Hilfe. Marcel
12
3049
by: Dennis Schulz | last post by:
hi alle, ich bin blutiger C Anfänger und hier ist mein Versuch ein Strukt in eine Datei zu schreiben, bzw anzuhängen. Leider wird die datei zwar angelegt aber nichts reingeschrieben. Besonders die Stelle mit dem Fischzeiger kommt mir komisch vor, aber fwrite erwartet als ersten Parameter nunmal einen Zeiger und ich weiss sonst nicht was ich machen soll. Bitte helft mir. mfg Dennis
0
1152
by: Brunner | last post by:
Hi, I'd like to print a diagram which is embedded in a formular. The only possibility I found is to draw the diagram in print event handler by hand on a Graphics. However this seems to be very circumstantial, because the diagram already exists on that formular. Is there a way to print the diagram or the whole formular without redrawing it manually? thanks.
0
1082
by: Johannes Eble | last post by:
Hallo allerseits, ich habe eine Webform, die u.a. zwei User Controls enthaelt, sagen wir usrA.ascx und usrB.ascx. usrB.ascx enthaelt wiederrum ein User Control usrBB.ascx. usrA.ascx enthaelt eine Dropdown List ddL1 mit Autopostback=True und einem ddL1_SelectedIndexChanged Handler. Diesen Event muss jetzt auch usrBB erhalten. Wie mache ich das?
7
3455
by: MIKQ | last post by:
Hi, ich habe ein eindimesionales Array dessen ca. 5 Werte (01234) ich in _eine_ Zelle schreiben will. Um in Excel zu schreiben habe ich folgende Sub geschrieben: Private Sub ExcelAusgabe(ByVal Wert() As Integer) Dim xlApp As Excel.Application
0
1598
by: Bastian | last post by:
Hi, ich benutze PHP und PostgreSQL. Folgendes Problem: Eine Seite zeigt die Daten, die in einer Tabelle der DB abgespeichert sind. Der Benutzer wählt dann einen Datensatz aus, den er gerne bearbeiten oder löschen möchte. Auf der nächsten Seite wird die Aktion dann ausgeführt. Es ist möglich LOCKS zu setzen, um zu verhindern, dass sich 2 DELETES bzw. UPDATES in die Quere kommen, bzw. werden implizit gesetzt. Aber wenn ein Benutzer sich...
1
2905
by: Hugo Balazs | last post by:
Hallo NG, ich möchte mit einem install-script mehrere Tabellen erstellen und habe es zum Testen mit dem Befehl "mysql_query" versucht. Eine Tabelle erstellen funktioniert einwandfrei. Ab zwei bekomme ich eine Fehlermeldung betreffend SQL-Syntax. Mit phpMyAdmin ist es möglich das gesamte SQL-Script in einem einzigen Formularfenster einzutippen und hochzuladen. Wo mache ich was falsch und wie könnte eine Lösung aussehen?
0
2482
by: Spooks | last post by:
Hi Leute, hier mein kleines Problem: Ich möchte die Tabellen eines SQL Servers auslesen und anschließend die Daten der Tabellen in die Tabellen der Access Datenbank schreiben! (Die Access Datenbank und die Tabellen sind vorhanden) Doch irgendwie will das ganze einfach nicht funktionieren!!! Vielleicht könnt ja Ihr mir irgendwie helfen.
1
1436
by: jamesonworld | last post by:
Hi I am finding it hard to understand the script below <SCRIPT language=JavaScript> <!-- Begin var i = 0; // interest var m = 0; // months var f = 0; // factor var den = 0; var s = "0"; // string var d = 0; // decimal place
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9259
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.