473,503 Members | 12,516 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 3796
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_BeforeUpdate(Cancel As Integer)
If isnull(me!laufendenummer) then
Me!laufendenummer = Nz(DMax("laufendenummer","table"),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.google. 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.Value = 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
3684
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...
12
3026
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...
0
1144
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...
0
1075
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...
7
3441
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...
0
1585
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...
1
2894
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...
0
2474
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...
1
1425
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"; //...
0
7098
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
7296
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,...
0
7364
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
7470
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...
1
5026
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...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
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...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.