Question with tables andd forms

11panos04

Registered User.
Local time
Yesterday, 20:13
Joined
Sep 28, 2017
Messages
16
In a table i ve named a column as m/s and set it to accept the ''m'' or ''s'', and each row is automatically numbered 1,2,3 etc. What i wanna do is when i change it to ''s'' i want it to give me four rows named a,b,c,d.For example,first row set to ''m'' and numbered ''1''.Second row if i want to change it to ''s'' and press enter i want it to give me 4 rows numbered as 2a,2b,2c,2d,etc etc.I want to make a form of this table,i didn t know if something i must do to the table or the form.Any ideas???
 
look at the attached sample db.
Open MSFormContinuous or MSFormDatasheet.
is this what you want.
 

Attachments

by column I assume you mean a field. The first thing you should do is remove the special character(/) from the field name.

As for the rest of your question i'm not very clear on what it is you want to do.
can you give more info on what your data is and the reason for the rows or records.
 
arnelgp,msformdatasheet is exactly what i was looking for;) .I want to use this as a secondary form in another main form,of the example like this: A main form,where u put the name,place etc of the customer and in the secondary form(the form u made) the products that customer chooses,but i need it for a club program,and we only had option M for one of a kind or S for four.Can u tell me how u did that???
 
open the form in design view.
click on m/s textbox.
on its Property->Event, click on AfterUpdate
and you will see the code.
 
I looked at the code but i didn t see how to change that a.b.c.d for example to greek letters(as the club is greek),so i upload tthe table maybe u figure it out.The Μ/Σ is m/s like previously and ΑρΚλουβιου is the numbers.
 

Attachments

i cannot create the letters, i am using EN Office.
this is what you have to do.
Create a Query based on the table.
add those two fields in the query.
save your query.
Create a Datasheet form against the Query.
Put your form in Design View.
Click on M/S textbox and on the right Window (Property)

Choose AfterUpdate from Event
Choose [Event Procedure]
Now paste this in side the procedure:


Dim ID As Long
Dim i As Byte
Dim rs As DAO.Recordset
''''''''''''''''''''''''''''''''''
' replace xxx with your field name
''''''''''''''''''''''''''''''''''
ID = Val(Nz(DMax("xxx", "msTable"), 0)) + 1
If Me.m_s = "m" Then
Me.rows = ID & ""
Me.Dirty = False
Else
Me.rows = ID & "a" '<== replace this with your "a" letter
Me.Dirty = False
Set rs = Me.RecordsetClone
For i = 1 To 3
rs.AddNew
rs("m/s") = Me.m_s
rs("rows") = ID & Choose(i, "b", "c", "d") '<== replace the letters with your letter
rs.Update
Next
End If
Me.Recalc





***
replaced those that i commented with correct fieldname and greek letters.
 

Users who are viewing this thread

Back
Top Bottom