473,472 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to update FlexGrid using data entry form?

Mas Juliza Alias
67 New Member
Hi,

I have a data entry form where user can enter details to be added into a MSFlexGrid; which is contained in another separate form. The data are supposed to be updated on a new row of the grid each time the Add button is clicked. Here is what I have so far
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdAdd_Click()
  2.     Dim i As Integer
  3.     i = 0
  4.     If chkDisplayTable.Value = 1 Then
  5.         frmDisplayTideGrid.Show
  6.     Else
  7.         frmDisplayTideGrid.Hide
  8.     End If
  9.     With frmDisplayTideGrid
  10.         With .GridTide
  11.             .TextMatrix(i, 0) = txtDate
  12.             .TextMatrix(i, 1) = txtHour & ":" & txtMin
  13.             .TextMatrix(i, 2) = txtTide
  14.         End With
  15.     End With
  16.  
  17. End Sub
By using this code, the entered data are always updating the first row. How to fix this?
Thank You in advance.
Attached Images
File Type: jpg dataentryform.jpg (23.8 KB, 708 views)
File Type: jpg grid.jpg (20.1 KB, 914 views)
Sep 7 '11 #1
4 4829
Guido Geurs
767 Recognized Expert Contributor
you set i = 0
and then you add to row i the data=
.TextMatrix(i, 0) = txtDate
.TextMatrix(i, 1) = txtHour & ":" & txtMin
.TextMatrix(i, 2) = txtTide
So you set the data to (0,0); (0,1) and (0,2) or = the first row.

You can APPEND the data with:
Expand|Select|Wrap|Line Numbers
  1.  MSFlexGrid1.AddItem txtDate & vbtab & _
  2.                      txtHour & ":" & txtMin  & vbtab & _
  3.                      txtTide
Sep 8 '11 #2
Mas Juliza Alias
67 New Member
Do I need to use For/Next to add new row? And where to put the APPEND code?
Attached Files
File Type: zip 110909015349-87586.zip (5.0 KB, 237 views)
Sep 9 '11 #3
Guido Geurs
767 Recognized Expert Contributor
You don't need a For-Next, the .Additem adds a new row and places the data in its cells.(see attachment)
APPEND is not a command, it's just the verb = "add at the end".
Attached Files
File Type: zip How to update FlexGrid using data entry form_v1.0.0.zip (4.9 KB, 350 views)
Sep 9 '11 #4
Guido Geurs
767 Recognized Expert Contributor
This is a nice program but did you consider the next topics:

- ergonomics for the user:
Why a separated input box for hour and min.?
Why not one inputbox and enter the data with dot like 12.26 ?

- What if there is an error in the grid (data mistyped or a row missing!
Retype the hole grid ?

So: why not entering the data in a textbox and put it with the program in a grid once all the data is entered in text format (easy to correct, store, ...)
You can enter it like:
12 26 1.235
12 30 1.259
12 42 1.351
...
just like the auto generated data from previous project.
Sep 10 '11 #5

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

Similar topics

2
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5...
1
by: Alex Wisnoski | last post by:
Access 97SR2-I am trying to create a Job Position data entry form based on a table. The form has 15 fields on it. I want to use a combo box to look in the table and see if the position number...
3
by: intl04 | last post by:
Is it possible to create a Word form as the data entry form for an Access database? I didn't see any reference to this possibility in my Access books, so I'm sorry if this is a question that is...
1
by: Alex.Wisnoski | last post by:
I have a data entry form with a combo box to look up an entrant's name. If the name is already in the table then it pulls up the record and that part of the form works fine. If the name isn't in...
1
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting...
1
by: ajw | last post by:
I am a VB.NET newbie... I have a data entry form with text boxes bound to a dataset. The data source is an Access table with the primary key field being an autoincrement field. Everything works...
2
by: filbennett | last post by:
Hi Everyone, I'm generally unfamiliar with Access form design, but have programmed Cold Fusion applications for a couple of years. I'd like to build a data entry form in Access that allows the...
4
by: JohnnyMid | last post by:
I am working on a database, and have been having some trouble with the auto number feature. Occasionally, the data entry form is saving blank records into the table. I am trying to figure out a way...
2
by: seltzer | last post by:
I am using Access 2000 but I also have the 2003 version. I am working on creating a data entry form in Access for a research study. Since there is a maximum of 255 fields per table in Access, I...
0
by: Tyler | last post by:
Made a data entry form which is a subform. I made a continuous form that displays everything entered through the data entry form. The data entry form displays all of the records. This doesn't...
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
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
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...
1
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.